Home
Explore
Submit Search
Upload
Login
Signup
Advertisement
Check these out next
Linux Device Tree
艾鍗科技
USB Drivers
Anil Kumar Pugalia
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
Embedded C programming session10
Keroles karam khalil
8051 architecture
sb108ec
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
Pcie basic
Saifuddin Kaijar
Embedded Software Design
Anil Kumar Pugalia
1
of
18
Top clipped slide
Interrupts
Jun. 28, 2010
•
0 likes
14 likes
×
Be the first to like this
Show More
•
47,104 views
views
×
Total views
0
On Slideshare
0
From embeds
0
Number of embeds
0
Report
Technology
Entertainment & Humor
Interrupts, SoftIRQs and their handling in Linux
Anil Kumar Pugalia
Follow
Linux Geek and Open Source Hardware & Software Freak, Corporate Trainer, Entrepreneur in Automation
Advertisement
Advertisement
Advertisement
Recommended
Introduction to Linux Drivers
Anil Kumar Pugalia
64.1K views
•
29 slides
Network Drivers
Anil Kumar Pugalia
38.6K views
•
15 slides
I2C Drivers
SysPlay eLearning Academy for You
28.4K views
•
28 slides
Bootloaders
Anil Kumar Pugalia
9.7K views
•
19 slides
SPI Drivers
SysPlay eLearning Academy for You
13.1K views
•
20 slides
Block Drivers
Anil Kumar Pugalia
37.9K views
•
21 slides
More Related Content
Slideshows for you
(20)
Linux Device Tree
艾鍗科技
•
4.3K views
USB Drivers
Anil Kumar Pugalia
•
42.4K views
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
•
4.4K views
Embedded C programming session10
Keroles karam khalil
•
1.2K views
8051 architecture
sb108ec
•
36K views
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
•
51.6K views
Pcie basic
Saifuddin Kaijar
•
10.5K views
Embedded Software Design
Anil Kumar Pugalia
•
6.9K views
Uart
Aditee Apurvaa
•
3.9K views
Interrupts
Albin Panakkal
•
5.5K views
Unit 1 MPMC
tamilnesaner
•
330 views
U-Boot presentation 2013
Wave Digitech
•
18.6K views
Device Tree for Dummies (ELC 2014)
Thomas Petazzoni
•
1.7K views
Introduction to Linux
Anil Kumar Pugalia
•
11.1K views
Computer architecture input output organization
Mazin Alwaaly
•
14.2K views
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
•
18K views
Interrupts of 8085
ShivamSood22
•
7.7K views
Board Bringup
Anil Kumar Pugalia
•
28.1K views
Soc architecture and design
Satya Harish
•
5.6K views
Character Drivers
Anil Kumar Pugalia
•
56.3K views
Similar to Interrupts
(20)
Serial Drivers
SysPlay eLearning Academy for You
•
16.7K views
Signals
Anil Kumar Pugalia
•
9.6K views
Kernel Debugging & Profiling
Anil Kumar Pugalia
•
18.8K views
SR-IOV Introduce
Lingfei Kong
•
4.2K views
IRQs: the Hard, the Soft, the Threaded and the Preemptible
Alison Chaiken
•
1.7K views
MICROCONTROLLER PROGRAMMING.pdf
KarthiA15
•
6 views
Kernel Debugging & Profiling
Anil Kumar Pugalia
•
5.8K views
Rsockets ofa12
trustitrusti
•
928 views
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
FastBit Embedded Brain Academy
•
3K views
Kernel Timing Management
SysPlay eLearning Academy for You
•
3K views
Synchronization
Anil Kumar Pugalia
•
8.8K views
Quick and Easy Device Drivers for Embedded Linux Using UIO
Chris Simmonds
•
21.8K views
Training report on embedded sys_AVR
Galgotias College of Engg. & Tech.
•
550 views
SPI Drivers
SysPlay eLearning Academy for You
•
9.8K views
With suitable diagram explain the working of 8255 a and inerrupts
ransherraj
•
33 views
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Intel® Software
•
7.3K views
OSMC 2014: Server Hardware Monitoring done right | Werner Fischer
NETWAYS
•
641 views
Summer training embedded system and its scope
Arshit Rai
•
1.6K views
리눅스 드라이버 #2
Sangho Park
•
1.1K views
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Kuniyasu Suzaki
•
2.5K views
Advertisement
More from Anil Kumar Pugalia
(20)
File System Modules
Anil Kumar Pugalia
•
20.4K views
Processes
Anil Kumar Pugalia
•
6.8K views
System Calls
Anil Kumar Pugalia
•
4K views
Introduction to Linux
Anil Kumar Pugalia
•
3.8K views
Embedded C
Anil Kumar Pugalia
•
25.6K views
Playing with R L C Circuits
Anil Kumar Pugalia
•
2.8K views
Audio Drivers
Anil Kumar Pugalia
•
20.5K views
Video Drivers
Anil Kumar Pugalia
•
23K views
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
•
5.9K views
Shell Scripting
Anil Kumar Pugalia
•
6.1K views
References
Anil Kumar Pugalia
•
21.7K views
Functional Programming with LISP
Anil Kumar Pugalia
•
6.1K views
Power of vi
Anil Kumar Pugalia
•
2.9K views
gcc and friends
Anil Kumar Pugalia
•
14.2K views
"make" system
Anil Kumar Pugalia
•
4.1K views
Hardware Design for Software Hackers
Anil Kumar Pugalia
•
1.7K views
RPM Building
Anil Kumar Pugalia
•
4K views
Linux User Space Debugging & Profiling
Anil Kumar Pugalia
•
6.4K views
Linux Network Management
Anil Kumar Pugalia
•
11.1K views
System Calls
Anil Kumar Pugalia
•
9.7K views
Recently uploaded
(20)
Refactr.tech.pptx
Elizabeth (Lizzie) Siegle
•
8 views
NS-CUK Seminar: J.H.Lee, Review on "GCC: Graph Contrastive Coding for Graph ...
ssuser4b1f48
•
0 views
Plant Disease Detection.pptx
vikasmittal92
•
2 views
Spring_Boot_Microservices-5_Day_Session.pptx
Prabhakaran Ravichandran
•
0 views
如何办理一份高仿科克大学毕业证成绩单?
aazepp
•
3 views
Networking Hardware Requirements.pptx
JhamaikaPaet
•
1 view
如何办理一份高仿纽约州立大学宾汉姆顿分校毕业证成绩单?
aazepp
•
0 views
Will AI take over our jobs .pptx
Alfredo Mancera
•
11 views
NS-CUK Seminar: V.T.Hoang, Review on "Graph Clustering with Graph Neural Netw...
ssuser4b1f48
•
0 views
如何办理一份高仿东伦敦大学毕业证成绩单?
aazepp
•
3 views
Digital Marketing Plan.pdf
mennaHendy
•
4 views
jsday 2023: Build ChatGPT over SMS in Italy
Elizabeth (Lizzie) Siegle
•
8 views
solar panel.pptx
AbdulberBaig
•
3 views
【本科生、研究生】美国德鲁大学毕业证文凭购买指南
sutseu
•
0 views
Technology Companies Development Story
Hamidreza Soleimani
•
0 views
pdf.pdf
YenenehMulat
•
0 views
如何办理一份高仿南达科他大学毕业证成绩单?
aazepp
•
3 views
What are the Reactjs Properties
TutorialsFreak
•
0 views
ARTIFICIAL INTELLIGENCE.pptx
Butterfly education
•
6 views
Azure Pizza as a Service Model
Carlo Sacchi
•
7 views
Advertisement
Interrupts
© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Interrupts
2© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? W's & How's of Interrupts? The IRQ Interrupt Handling & Handlers Soft IRQs
3© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. W's of an Interrupt? What is an Interrupt? Intervention to get Attention Here, from the Devices to the CPU Why is an Interrupt required? Mismatch of Device & CPU speeds Get overall better efficiency & latency
4© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. How does interrupt work? Interrupt is a Hardware thing It needs Physical connection In Processors Typically have one or two interrupt lines Handled by a Interrupt Controller, called PIC And PIC informs the Processor through its one line In Micro-controllers Each GPIO can act as an interrupt line Interrupt Controller is in-built In both cases, the CPU then decodes the IRQ And calls the corresponding registered interrupt handler
5© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Interrupt ReQuest (IRQ) Number derived by CPU & Board Programmed or Hard Coded with Interrupt Controller Hence, one key component of LSPs In x86 CPU Specific: 0x00 to 0x1F (Hard coded) Board Specific: 0x20 to 0xFF Header: <asm/interrupt.h> → <asm/irq.h> → irq*.h In Microcontrollers Depends on the controller Header: <asm/interrupt.h> → <asm/irq.h> → irq*.h
6© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Programming Interface Header: <asm/interrupt.h> Type: typedef irqreturn_t (*irq_handler_t)(int, void *); APIs int request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, const char *name, void *dev_id); void free_irq(unsigned int irq, void *dev_id); int can_request_irq(irq, flags); Flags IRQF_TRIGGER_RISING, ..., IRQF_TRIGGER_HIGH, ... IRQF_SAMPLE_RANDOM IRQF_SHARED, ...
7© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. IRQ Handler Do's & Don'ts No sleeping – direct or indirect Example: schedule_timeout, input_register_device No mutexes Rather use spin_locks, if you must Can't exchange data with User Space In their own context. current is invalid If lot to be done, break it into two Top Half & Bottom Half Need not be re-entrant May get interrupted by higher priority interrupt handlers
8© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Additional Info IRQ Control enable_irq(irq); disable_irq(irq); IRQ Handler returns IRQ_NONE IRQ_HANDLED Check for execution state in_interrupt(); Synchronous interrupts, treated alike Exceptions to report grave runtime errors Software interrupts such as the int 0x80 used for system calls in x86 architecture
9© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Message Signaled Interrupts Specifically for PCI Devices Advantages No sharing, No sync issues, More interrupts Modes: MSI or MSI-X (only one at a time) MSI (since PCI 2.2) Special Address: PCI config space Interrupts / Device: Upto 32 in powers of 2 MSI-X (since PCI 3.0) Special Address: Bus address Interrupts / Device: Sparse & upto 2048
10© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. MSI/MSI-X APIs MSI int pci_enable_msi(strcut pci_dev *); int pci_enable_msi_block(strcut pci_dev *, int cnt); void pci_disable_msi(strcut pci_dev *); MSI-X int pci_enable_msix(strcut pci_dev *, struct msix_entry *, int nvec); struct msix_entry { u16 vector /* allocated irq */, entry; }; void pci_disable_msix(strcut pci_dev *);
11© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Soft IRQs
12© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What is a Soft IRQ? Basic Bottom Half Synchronous Interrupt Have strong locking requirements Used for the performance sensitive subsystems Not same as Software Interrupt
13© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Typical Soft IRQs Timer Network Block Tasklet Scheduler High Resolution Timer
14© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Linux Execution Model Interrupt Handlers Soft IRQ Handlers Kernel Threads Timer Network... Timer Network...Scheduler ... User Processes Work Q Kernel Thread User Process Pn User Process P1 ...
15© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Programming Header: <linux/interrupt.h> APIs void open_softirq(int nr, void (*action)(struct softirq_action *)); void raise_softirq(unsigned int nr);
16© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Top & Bottom Halves Top Half Registered through request_irq Bottom Half Tasklet Soft IRQ Context Fast & Atomic Only different tasklets can run on different CPUs Work Queue Special Kernel Process Context Allowed to sleep Can run simultaneously on different CPUs
17© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? W's & How's of Interrupts? The IRQ Interrupt Handling & Handlers Message Signalled Interrupts Soft IRQs: The Bottom Halves
18© 2010-15 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?
Advertisement