aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-10-05 09:55:46 -0400
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-10-05 10:10:12 -0400
commit7d12e780e003f93433d49ce78cfedf4b4c52adc5 (patch)
tree6748550400445c11a306b132009f3001e3525df8 /drivers/media/dvb
parentda482792a6d1a3fbaaa25fae867b343fb4db3246 (diff)
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-pci.c2
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.c2
-rw-r--r--drivers/media/dvb/bt8xx/bt878.c2
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c4
-rw-r--r--drivers/media/dvb/dvb-usb/usb-urb.c2
-rw-r--r--drivers/media/dvb/pluto2/pluto2.c2
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c2
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c4
8 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c
index eb2e6432c8c2..06893243f3d4 100644
--- a/drivers/media/dvb/b2c2/flexcop-pci.c
+++ b/drivers/media/dvb/b2c2/flexcop-pci.c
@@ -122,7 +122,7 @@ static void flexcop_pci_irq_check_work(void *data)
122/* When PID filtering is turned on, we use the timer IRQ, because small amounts 122/* When PID filtering is turned on, we use the timer IRQ, because small amounts
123 * of data need to be passed to the user space instantly as well. When PID 123 * of data need to be passed to the user space instantly as well. When PID
124 * filtering is turned off, we use the page-change-IRQ */ 124 * filtering is turned off, we use the page-change-IRQ */
125static irqreturn_t flexcop_pci_isr(int irq, void *dev_id, struct pt_regs *regs) 125static irqreturn_t flexcop_pci_isr(int irq, void *dev_id)
126{ 126{
127 struct flexcop_pci *fc_pci = dev_id; 127 struct flexcop_pci *fc_pci = dev_id;
128 struct flexcop_device *fc = fc_pci->fc_dev; 128 struct flexcop_device *fc = fc_pci->fc_dev;
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c
index 515954f96c9a..2853ea1bdaf1 100644
--- a/drivers/media/dvb/b2c2/flexcop-usb.c
+++ b/drivers/media/dvb/b2c2/flexcop-usb.c
@@ -328,7 +328,7 @@ static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb, u8 *buffer, in
328 fc_usb->tmp_buffer_length = l; 328 fc_usb->tmp_buffer_length = l;
329} 329}
330 330
331static void flexcop_usb_urb_complete(struct urb *urb, struct pt_regs *ptregs) 331static void flexcop_usb_urb_complete(struct urb *urb)
332{ 332{
333 struct flexcop_usb *fc_usb = urb->context; 333 struct flexcop_usb *fc_usb = urb->context;
334 int i; 334 int i;
diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c
index 755822ee6e9b..329a51c18562 100644
--- a/drivers/media/dvb/bt8xx/bt878.c
+++ b/drivers/media/dvb/bt8xx/bt878.c
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(bt878_stop);
266/* Interrupt service routine */ 266/* Interrupt service routine */
267/*****************************/ 267/*****************************/
268 268
269static irqreturn_t bt878_irq(int irq, void *dev_id, struct pt_regs *regs) 269static irqreturn_t bt878_irq(int irq, void *dev_id)
270{ 270{
271 u32 stat, astat, mask; 271 u32 stat, astat, mask;
272 int count; 272 int count;
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index 410fa6d620ff..ff7d4f56ced3 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -238,7 +238,7 @@ static void cinergyt2_sleep (struct cinergyt2 *cinergyt2, int sleep)
238 cinergyt2->sleeping = sleep; 238 cinergyt2->sleeping = sleep;
239} 239}
240 240
241static void cinergyt2_stream_irq (struct urb *urb, struct pt_regs *regs); 241static void cinergyt2_stream_irq (struct urb *urb);
242 242
243static int cinergyt2_submit_stream_urb (struct cinergyt2 *cinergyt2, struct urb *urb) 243static int cinergyt2_submit_stream_urb (struct cinergyt2 *cinergyt2, struct urb *urb)
244{ 244{
@@ -258,7 +258,7 @@ static int cinergyt2_submit_stream_urb (struct cinergyt2 *cinergyt2, struct urb
258 return err; 258 return err;
259} 259}
260 260
261static void cinergyt2_stream_irq (struct urb *urb, struct pt_regs *regs) 261static void cinergyt2_stream_irq (struct urb *urb)
262{ 262{
263 struct cinergyt2 *cinergyt2 = urb->context; 263 struct cinergyt2 *cinergyt2 = urb->context;
264 264
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index 572b2d9aa66a..78035ee824ca 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -11,7 +11,7 @@
11#include "dvb-usb-common.h" 11#include "dvb-usb-common.h"
12 12
13/* URB stuff for streaming */ 13/* URB stuff for streaming */
14static void usb_urb_complete(struct urb *urb, struct pt_regs *ptregs) 14static void usb_urb_complete(struct urb *urb)
15{ 15{
16 struct usb_data_stream *stream = urb->context; 16 struct usb_data_stream *stream = urb->context;
17 int ptype = usb_pipetype(urb->pipe); 17 int ptype = usb_pipetype(urb->pipe);
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c
index 2310b2bfed4e..8e4ce101eb22 100644
--- a/drivers/media/dvb/pluto2/pluto2.c
+++ b/drivers/media/dvb/pluto2/pluto2.c
@@ -306,7 +306,7 @@ static void pluto_dma_end(struct pluto *pluto, unsigned int nbpackets)
306 TS_DMA_BYTES, PCI_DMA_FROMDEVICE); 306 TS_DMA_BYTES, PCI_DMA_FROMDEVICE);
307} 307}
308 308
309static irqreturn_t pluto_irq(int irq, void *dev_id, struct pt_regs *regs) 309static irqreturn_t pluto_irq(int irq, void *dev_id)
310{ 310{
311 struct pluto *pluto = dev_id; 311 struct pluto *pluto = dev_id;
312 u32 tscr; 312 u32 tscr;
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 234199875f53..60820deb900b 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -732,7 +732,7 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
732 } 732 }
733} 733}
734 734
735static void ttusb_iso_irq(struct urb *urb, struct pt_regs *ptregs) 735static void ttusb_iso_irq(struct urb *urb)
736{ 736{
737 struct ttusb *ttusb = urb->context; 737 struct ttusb *ttusb = urb->context;
738 738
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index de077a757192..a1c9fa9919ea 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -203,7 +203,7 @@ static u16 rc_keys[] = {
203static void ttusb_dec_set_model(struct ttusb_dec *dec, 203static void ttusb_dec_set_model(struct ttusb_dec *dec,
204 enum ttusb_dec_model model); 204 enum ttusb_dec_model model);
205 205
206static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs) 206static void ttusb_dec_handle_irq( struct urb *urb)
207{ 207{
208 struct ttusb_dec * dec = urb->context; 208 struct ttusb_dec * dec = urb->context;
209 char *buffer = dec->irq_buffer; 209 char *buffer = dec->irq_buffer;
@@ -755,7 +755,7 @@ static void ttusb_dec_process_urb_frame_list(unsigned long data)
755 } 755 }
756} 756}
757 757
758static void ttusb_dec_process_urb(struct urb *urb, struct pt_regs *ptregs) 758static void ttusb_dec_process_urb(struct urb *urb)
759{ 759{
760 struct ttusb_dec *dec = urb->context; 760 struct ttusb_dec *dec = urb->context;
761 761