From 88771a90b911f0b285b6bced890f1e9cc5cd81f1 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Wed, 18 Apr 2012 11:02:53 -0500 Subject: [PATCH 2/2] Revert "dahdi_dynamic_eth: Move tx packet flushing to process context." dahdi_dynamic now always calls the flush function in softirq context so packet flushing no longer needs to be pushed off to process context since interrupts are enabled. Signed-off-by: Shaun Ruffell --- drivers/dahdi/dahdi_dynamic_eth.c | 41 ++++--------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/drivers/dahdi/dahdi_dynamic_eth.c b/drivers/dahdi/dahdi_dynamic_eth.c index fd3a8cd..e92ba30 100644 --- a/drivers/dahdi/dahdi_dynamic_eth.c +++ b/drivers/dahdi/dahdi_dynamic_eth.c @@ -186,43 +186,15 @@ static void ztdeth_transmit(struct dahdi_dynamic *dyn, u8 *msg, size_t msglen) } /** - * dahdi_dynamic_flush_work_fn - Flush all pending transactions. - * - * This function is run in a work queue since we can't guarantee interrupts - * will be enabled when we're called, and dev_queue_xmit() requires that - * interrupts be enabled. - * - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static void dahdi_dynamic_flush_work_fn(void *data) -#else -static void dahdi_dynamic_flush_work_fn(struct work_struct *work) -#endif -{ - struct sk_buff *skb; - /* Handle all transmissions now */ - while ((skb = skb_dequeue(&skbs))) { - dev_queue_xmit(skb); - } -} - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static DECLARE_WORK(dahdi_dynamic_eth_flush_work, - dahdi_dynamic_flush_work_fn, NULL); -#else -static DECLARE_WORK(dahdi_dynamic_eth_flush_work, - dahdi_dynamic_flush_work_fn); -#endif - -/** * ztdeth_flush - Flush all pending transactions. * - * This function is called in interrupt context while processing the master - * span. + * This function is always called in softirq context. */ static int ztdeth_flush(void) { - schedule_work(&dahdi_dynamic_eth_flush_work); + struct sk_buff *skb; + while ((skb = skb_dequeue(&skbs))) + dev_queue_xmit(skb); return 0; } @@ -446,11 +418,6 @@ static int __init ztdeth_init(void) static void __exit ztdeth_exit(void) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) - flush_scheduled_work(); -#else - cancel_work_sync(&dahdi_dynamic_eth_flush_work); -#endif dahdi_dynamic_unregister_driver(&ztd_eth); unregister_netdevice_notifier(&ztdeth_nblock); dev_remove_pack(&ztdeth_ptype); -- 1.7.10