Skip to contentSkip to conversation

arch/mips/au1000/common/irq.c

DISCUSSION Jeff Baitis 3 participants 5 messages Mar 13, 2003 MIPS

lore
Share & tools
lore
#0 lore raw

Pete:

I've got a question concerning irq.c. In intc0_req0_irqdispatch() (linux_2_4 branch) on lines 545 thru 552, the code reads:

      for (i=0; i<32; i++) {
          if ((intc0_req0 & (1<<i))) {
              intc0_req0 &= ~(1<<i);
              do_IRQ(irq, regs);
              break;
          }
          irq++;
      }

My question is: why do we increment i and irq independently? Why doesn't the code read:

      for (i=0; i<32; i++) {
          if ((intc0_req0 & (1<<i))) {
              intc0_req0 &= ~(1<<i);
              do_IRQ(i, regs);
              break;
          }
      }

Thanks for your help!

-Jeff

Signature · 7 lines
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  [email protected] 
#1 lore raw
Quoted 4 lines · Jeff Baitis

Pete:

I've got a question concerning irq.c. In intc0_req0_irqdispatch() (linux_2_4 branch) on lines 545 thru 552, the code reads:

I'm hacking these functions to use 'clz' and for other updates, so the code will be changing soon, anyway :-) Comment on the next version :-)

Thanks.

	-- Dan
#2 lore raw

Dan:

I just verified that I get an IRQ storm when I plug a 3.3-volt based SMC EPIC/100 network card into the PCI slot of the Au1500. Before I bring the interface up, I notice that the driver tries to allocate IRQ 1 (INTA). This is the same IRQ that the ill-fated CardBus bridge attempts to use. ;)

As soon as I bring the SMC interface up using ifconfig (and have the interface plugged into an active Ethernet network), the IRQ storm ensues.

I'll try Hartvig's patch, look over the irq.c levels, and see how everything fares.

Thanks all!

Regards,

Jeff

Quoted 17 lines · Dan Malek
Quoted 4 lines · Jeff Baitis

Pete:

I've got a question concerning irq.c. In intc0_req0_irqdispatch() (linux_2_4 branch) on lines 545 thru 552, the code reads:

I'm hacking these functions to use 'clz' and for other updates, so the code will be changing soon, anyway :-) Comment on the next version :-)

Thanks.

	-- Dan
Signature · 7 lines
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  [email protected] 
#3 lore raw

Hartvig's patch has solved my IRQ storm problems. Thank you all very much for your attention!

Regards,

Jeff

Quoted 49 lines · Jeff Baitis

Dan:

I just verified that I get an IRQ storm when I plug a 3.3-volt based SMC EPIC/100 network card into the PCI slot of the Au1500. Before I bring the interface up, I notice that the driver tries to allocate IRQ 1 (INTA). This is the same IRQ that the ill-fated CardBus bridge attempts to use. ;)

As soon as I bring the SMC interface up using ifconfig (and have the interface plugged into an active Ethernet network), the IRQ storm ensues.

I'll try Hartvig's patch, look over the irq.c levels, and see how everything fares.

Thanks all!

Regards,

Jeff

Quoted 17 lines · Dan Malek
Quoted 4 lines · Jeff Baitis

Pete:

I've got a question concerning irq.c. In intc0_req0_irqdispatch() (linux_2_4 branch) on lines 545 thru 552, the code reads:

I'm hacking these functions to use 'clz' and for other updates, so the code will be changing soon, anyway :-) Comment on the next version :-)

Thanks.

	-- Dan
Signature · 7 lines
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  [email protected] 
Signature · 7 lines
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  [email protected] 
#4 lore raw
In reply to Jeff Baitis
Quoted 25 lines · Jeff Baitis

Pete:

I've got a question concerning irq.c. In intc0_req0_irqdispatch() (linux_2_4 branch) on lines 545 thru 552, the code reads:

      for (i=0; i<32; i++) {
          if ((intc0_req0 & (1<<i))) {
              intc0_req0 &= ~(1<<i);
              do_IRQ(irq, regs);
              break;
          }
          irq++;
      }

My question is: why do we increment i and irq independently? Why doesn't the code read:

      for (i=0; i<32; i++) {
          if ((intc0_req0 & (1<<i))) {
              intc0_req0 &= ~(1<<i);
              do_IRQ(i, regs);
              break;
          }
      }
Quoted 1 line

Thanks for your help!

No reason. It was probably more clear to me when writing the code and later I didn't look for such improvements. Like Dan said though, he's updating/optimizing that part of the code anyway ...

Pete