From c2343663850d8931f75a7dfe4317c62732c6fce1 Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Sat, 15 Nov 2008 23:38:19 -0500 Subject: cx18: Major rewrite of interrupt handling for incoming mailbox processing From: Andy Walls A major rewrite of interrupt handling for incoming mailbox processing, to split the timing critical steps from the the deferrable steps as the sending XPU on the CX23418 will time out and overwrite our incoming mailboxes rather quickly. Setup a pool of work "order forms" for the irq handler to send jobs to the new work handler routine which uses the kernel default work queue to do the deferrable work. Started optimizing some of the cx18-io calls as they are now the low hanging fruit for recoving microseconds back from the timeline. Future optimizations will get rid of mmio read retries, mmio stats logging, and combine smaller functions in the irq path into the larger ones to save ~2 us each. Priority: normal Signed-off-by: Andy Walls --- linux/drivers/media/video/cx18/cx18-driver.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video/cx18/cx18-driver.c') diff --git a/linux/drivers/media/video/cx18/cx18-driver.c b/linux/drivers/media/video/cx18/cx18-driver.c index 54f0fde42..725ed2847 100644 --- a/linux/drivers/media/video/cx18/cx18-driver.c +++ b/linux/drivers/media/video/cx18/cx18-driver.c @@ -440,6 +440,8 @@ done: */ static int __devinit cx18_init_struct1(struct cx18 *cx) { + int i; + cx->base_addr = pci_resource_start(cx->dev, 0); mutex_init(&cx->serialize_lock); @@ -451,11 +453,16 @@ static int __devinit cx18_init_struct1(struct cx18 *cx) spin_lock_init(&cx->lock); + for (i = 0; i < CX18_MAX_EPU_WORK_ORDERS; i++) { + cx->epu_work_order[i].cx = cx; + cx->epu_work_order[i].str = cx->epu_debug_str; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) - INIT_WORK(&cx->work, cx18_work_handler); + INIT_WORK(&cx->epu_work_order[i].work, cx18_epu_work_handler); #else - INIT_WORK(&cx->work, cx18_work_handler, cx); + INIT_WORK(&cx->epu_work_order[i].work, cx18_epu_work_handler, + &cx->epu_work_order[i].work); #endif + } /* start counting open_id at 1 */ cx->open_id = 1; -- cgit v1.2.3