Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
62dff709
Commit
62dff709
authored
Jul 25, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x86: convert i8259_lock to atomic_spinlock
Signed-off-by:
Thomas Gleixner
<
tglx@linutronix.de
>
parent
bde31e2e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
23 deletions
+23
-23
arch/x86/include/asm/i8259.h
arch/x86/include/asm/i8259.h
+1
-1
arch/x86/kernel/apic/io_apic.c
arch/x86/kernel/apic/io_apic.c
+2
-2
arch/x86/kernel/i8259.c
arch/x86/kernel/i8259.c
+15
-15
arch/x86/kernel/time_32.c
arch/x86/kernel/time_32.c
+2
-2
arch/x86/kernel/visws_quirks.c
arch/x86/kernel/visws_quirks.c
+3
-3
No files found.
arch/x86/include/asm/i8259.h
View file @
62dff709
...
...
@@ -24,7 +24,7 @@ extern unsigned int cached_irq_mask;
#define SLAVE_ICW4_DEFAULT 0x01
#define PIC_ICW4_AEOI 2
extern
spinlock_t
i8259A_lock
;
extern
atomic_
spinlock_t
i8259A_lock
;
extern
void
init_8259A
(
int
auto_eoi
);
extern
void
enable_8259A_irq
(
unsigned
int
irq
);
...
...
arch/x86/kernel/apic/io_apic.c
View file @
62dff709
...
...
@@ -1856,7 +1856,7 @@ __apicdebuginit(void) print_PIC(void)
printk
(
KERN_DEBUG
"
\n
printing PIC contents
\n
"
);
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
v
=
inb
(
0xa1
)
<<
8
|
inb
(
0x21
);
printk
(
KERN_DEBUG
"... PIC IMR: %04x
\n
"
,
v
);
...
...
@@ -1870,7 +1870,7 @@ __apicdebuginit(void) print_PIC(void)
outb
(
0x0a
,
0xa0
);
outb
(
0x0a
,
0x20
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
printk
(
KERN_DEBUG
"... PIC ISR: %04x
\n
"
,
v
);
...
...
arch/x86/kernel/i8259.c
View file @
62dff709
...
...
@@ -32,7 +32,7 @@
*/
static
int
i8259A_auto_eoi
;
DEFINE_SPINLOCK
(
i8259A_lock
);
DEFINE_
ATOMIC_
SPINLOCK
(
i8259A_lock
);
static
void
mask_and_ack_8259A
(
unsigned
int
);
struct
irq_chip
i8259A_chip
=
{
...
...
@@ -68,13 +68,13 @@ void disable_8259A_irq(unsigned int irq)
unsigned
int
mask
=
1
<<
irq
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
cached_irq_mask
|=
mask
;
if
(
irq
&
8
)
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
else
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
void
enable_8259A_irq
(
unsigned
int
irq
)
...
...
@@ -82,13 +82,13 @@ void enable_8259A_irq(unsigned int irq)
unsigned
int
mask
=
~
(
1
<<
irq
);
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
cached_irq_mask
&=
mask
;
if
(
irq
&
8
)
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
else
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
int
i8259A_irq_pending
(
unsigned
int
irq
)
...
...
@@ -97,12 +97,12 @@ int i8259A_irq_pending(unsigned int irq)
unsigned
long
flags
;
int
ret
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
if
(
irq
<
8
)
ret
=
inb
(
PIC_MASTER_CMD
)
&
mask
;
else
ret
=
inb
(
PIC_SLAVE_CMD
)
&
(
mask
>>
8
);
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
return
ret
;
}
...
...
@@ -150,7 +150,7 @@ static void mask_and_ack_8259A(unsigned int irq)
unsigned
int
irqmask
=
1
<<
irq
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
/*
* Lightweight spurious IRQ detection. We do not want
* to overdo spurious IRQ handling - it's usually a sign
...
...
@@ -183,7 +183,7 @@ handle_real_irq:
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
outb
(
0x60
+
irq
,
PIC_MASTER_CMD
);
/* 'Specific EOI to master */
}
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
return
;
spurious_8259A_irq:
...
...
@@ -285,24 +285,24 @@ void mask_8259A(void)
{
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
outb
(
0xff
,
PIC_MASTER_IMR
);
/* mask all of 8259A-1 */
outb
(
0xff
,
PIC_SLAVE_IMR
);
/* mask all of 8259A-2 */
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
void
unmask_8259A
(
void
)
{
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
/* restore master IRQ mask */
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
/* restore slave IRQ mask */
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
void
init_8259A
(
int
auto_eoi
)
...
...
@@ -311,7 +311,7 @@ void init_8259A(int auto_eoi)
i8259A_auto_eoi
=
auto_eoi
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
outb
(
0xff
,
PIC_MASTER_IMR
);
/* mask all of 8259A-1 */
outb
(
0xff
,
PIC_SLAVE_IMR
);
/* mask all of 8259A-2 */
...
...
@@ -356,5 +356,5 @@ void init_8259A(int auto_eoi)
outb
(
cached_master_mask
,
PIC_MASTER_IMR
);
/* restore master IRQ mask */
outb
(
cached_slave_mask
,
PIC_SLAVE_IMR
);
/* restore slave IRQ mask */
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
}
arch/x86/kernel/time_32.c
View file @
62dff709
...
...
@@ -84,11 +84,11 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
* manually to deassert NMI lines for the watchdog if run
* on an 82489DX-based system.
*/
spin_lock
(
&
i8259A_lock
);
atomic_
spin_lock
(
&
i8259A_lock
);
outb
(
0x0c
,
PIC_MASTER_OCW3
);
/* Ack the IRQ; AEOI will end it automatically. */
inb
(
PIC_MASTER_POLL
);
spin_unlock
(
&
i8259A_lock
);
atomic_
spin_unlock
(
&
i8259A_lock
);
}
#endif
...
...
arch/x86/kernel/visws_quirks.c
View file @
62dff709
...
...
@@ -581,7 +581,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
struct
irq_desc
*
desc
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
i8259A_lock
,
flags
);
/* Find out what's interrupting in the PIIX4 master 8259 */
outb
(
0x0c
,
0x20
);
/* OCW3 Poll command */
...
...
@@ -618,7 +618,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
outb
(
0x60
+
realirq
,
0x20
);
}
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
desc
=
irq_to_desc
(
realirq
);
...
...
@@ -636,7 +636,7 @@ static irqreturn_t piix4_master_intr(int irq, void *dev_id)
return
IRQ_HANDLED
;
out_unlock:
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
i8259A_lock
,
flags
);
return
IRQ_NONE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment