aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio
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/net/hamradio
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/net/hamradio')
-rw-r--r--drivers/net/hamradio/baycom_epp.c2
-rw-r--r--drivers/net/hamradio/baycom_par.c2
-rw-r--r--drivers/net/hamradio/baycom_ser_fdx.c2
-rw-r--r--drivers/net/hamradio/baycom_ser_hdx.c2
-rw-r--r--drivers/net/hamradio/dmascc.c4
-rw-r--r--drivers/net/hamradio/scc.c4
-rw-r--r--drivers/net/hamradio/yam.c2
7 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 9220de9f4fe7..1ed9cccd3c11 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -323,7 +323,7 @@ static int eppconfig(struct baycom_state *bc)
323 323
324/* ---------------------------------------------------------------------- */ 324/* ---------------------------------------------------------------------- */
325 325
326static void epp_interrupt(int irq, void *dev_id, struct pt_regs *regs) 326static void epp_interrupt(int irq, void *dev_id)
327{ 327{
328} 328}
329 329
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index 77411a00d1ee..5930aeb35015 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -270,7 +270,7 @@ static __inline__ void par96_rx(struct net_device *dev, struct baycom_state *bc)
270 270
271/* --------------------------------------------------------------------- */ 271/* --------------------------------------------------------------------- */
272 272
273static void par96_interrupt(int irq, void *dev_id, struct pt_regs *regs) 273static void par96_interrupt(int irq, void *dev_id)
274{ 274{
275 struct net_device *dev = (struct net_device *)dev_id; 275 struct net_device *dev = (struct net_device *)dev_id;
276 struct baycom_state *bc = netdev_priv(dev); 276 struct baycom_state *bc = netdev_priv(dev);
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index 55906c7b4bb1..59214e74b9cf 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -279,7 +279,7 @@ static __inline__ void ser12_rx(struct net_device *dev, struct baycom_state *bc,
279 279
280/* --------------------------------------------------------------------- */ 280/* --------------------------------------------------------------------- */
281 281
282static irqreturn_t ser12_interrupt(int irq, void *dev_id, struct pt_regs *regs) 282static irqreturn_t ser12_interrupt(int irq, void *dev_id)
283{ 283{
284 struct net_device *dev = (struct net_device *)dev_id; 284 struct net_device *dev = (struct net_device *)dev_id;
285 struct baycom_state *bc = netdev_priv(dev); 285 struct baycom_state *bc = netdev_priv(dev);
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index de95de8983da..3bcc57acbe6d 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -373,7 +373,7 @@ static inline void ser12_rx(struct net_device *dev, struct baycom_state *bc)
373 373
374/* --------------------------------------------------------------------- */ 374/* --------------------------------------------------------------------- */
375 375
376static irqreturn_t ser12_interrupt(int irq, void *dev_id, struct pt_regs *regs) 376static irqreturn_t ser12_interrupt(int irq, void *dev_id)
377{ 377{
378 struct net_device *dev = (struct net_device *)dev_id; 378 struct net_device *dev = (struct net_device *)dev_id;
379 struct baycom_state *bc = netdev_priv(dev); 379 struct baycom_state *bc = netdev_priv(dev);
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index c9a46b89942a..0f8b9afd55b4 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -249,7 +249,7 @@ static void start_timer(struct scc_priv *priv, int t, int r15);
249static inline unsigned char random(void); 249static inline unsigned char random(void);
250 250
251static inline void z8530_isr(struct scc_info *info); 251static inline void z8530_isr(struct scc_info *info);
252static irqreturn_t scc_isr(int irq, void *dev_id, struct pt_regs *regs); 252static irqreturn_t scc_isr(int irq, void *dev_id);
253static void rx_isr(struct scc_priv *priv); 253static void rx_isr(struct scc_priv *priv);
254static void special_condition(struct scc_priv *priv, int rc); 254static void special_condition(struct scc_priv *priv, int rc);
255static void rx_bh(void *arg); 255static void rx_bh(void *arg);
@@ -1142,7 +1142,7 @@ static inline void z8530_isr(struct scc_info *info)
1142} 1142}
1143 1143
1144 1144
1145static irqreturn_t scc_isr(int irq, void *dev_id, struct pt_regs *regs) 1145static irqreturn_t scc_isr(int irq, void *dev_id)
1146{ 1146{
1147 struct scc_info *info = dev_id; 1147 struct scc_info *info = dev_id;
1148 1148
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index df4b68142ac7..ec9b6d9b6f05 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -200,7 +200,7 @@ static void z8530_init(void);
200 200
201static void init_channel(struct scc_channel *scc); 201static void init_channel(struct scc_channel *scc);
202static void scc_key_trx (struct scc_channel *scc, char tx); 202static void scc_key_trx (struct scc_channel *scc, char tx);
203static irqreturn_t scc_isr(int irq, void *dev_id, struct pt_regs *regs); 203static irqreturn_t scc_isr(int irq, void *dev_id);
204static void scc_init_timer(struct scc_channel *scc); 204static void scc_init_timer(struct scc_channel *scc);
205 205
206static int scc_net_alloc(const char *name, struct scc_channel *scc); 206static int scc_net_alloc(const char *name, struct scc_channel *scc);
@@ -626,7 +626,7 @@ static void scc_isr_dispatch(struct scc_channel *scc, int vector)
626 626
627#define SCC_IRQTIMEOUT 30000 627#define SCC_IRQTIMEOUT 30000
628 628
629static irqreturn_t scc_isr(int irq, void *dev_id, struct pt_regs *regs) 629static irqreturn_t scc_isr(int irq, void *dev_id)
630{ 630{
631 unsigned char vector; 631 unsigned char vector;
632 struct scc_channel *scc; 632 struct scc_channel *scc;
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index f98f5777dfbb..3c4455bd466d 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -702,7 +702,7 @@ static void yam_tx_byte(struct net_device *dev, struct yam_port *yp)
702* ISR routine 702* ISR routine
703************************************************************************************/ 703************************************************************************************/
704 704
705static irqreturn_t yam_interrupt(int irq, void *dev_id, struct pt_regs *regs) 705static irqreturn_t yam_interrupt(int irq, void *dev_id)
706{ 706{
707 struct net_device *dev; 707 struct net_device *dev;
708 struct yam_port *yp; 708 struct yam_port *yp;