Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
62d40cef
Commit
62d40cef
authored
Jun 08, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: remove all request_irq calls that occur before kmalloc is set up
parent
20eab7e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
49 deletions
+46
-49
arch/ppc64/kernel/irq.c
arch/ppc64/kernel/irq.c
+3
-37
arch/ppc64/kernel/open_pic.c
arch/ppc64/kernel/open_pic.c
+18
-7
arch/ppc64/kernel/smp.c
arch/ppc64/kernel/smp.c
+6
-2
arch/ppc64/kernel/xics.c
arch/ppc64/kernel/xics.c
+19
-3
No files found.
arch/ppc64/kernel/irq.c
View file @
62d40cef
...
...
@@ -72,40 +72,6 @@ irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
int
ppc_spurious_interrupts
=
0
;
unsigned
long
lpEvent_count
=
0
;
/* nasty hack for shared irq's since we need to do kmalloc calls but
* can't very early in the boot when we need to do a request irq.
* this needs to be removed.
* -- Cort
*/
#define IRQ_KMALLOC_ENTRIES 16
static
int
cache_bitmask
=
0
;
static
struct
irqaction
malloc_cache
[
IRQ_KMALLOC_ENTRIES
];
extern
int
mem_init_done
;
void
*
irq_kmalloc
(
size_t
size
,
int
pri
)
{
unsigned
int
i
;
if
(
mem_init_done
)
return
kmalloc
(
size
,
pri
);
for
(
i
=
0
;
i
<
IRQ_KMALLOC_ENTRIES
;
i
++
)
if
(
!
(
cache_bitmask
&
(
1
<<
i
)
)
)
{
cache_bitmask
|=
(
1
<<
i
);
return
(
void
*
)(
&
malloc_cache
[
i
]);
}
return
0
;
}
void
irq_kfree
(
void
*
ptr
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
IRQ_KMALLOC_ENTRIES
;
i
++
)
if
(
ptr
==
&
malloc_cache
[
i
]
)
{
cache_bitmask
&=
~
(
1
<<
i
);
return
;
}
kfree
(
ptr
);
}
int
setup_irq
(
unsigned
int
irq
,
struct
irqaction
*
new
)
{
...
...
@@ -205,7 +171,7 @@ do_free_irq(int irq, void* dev_id)
/* Wait to make sure it's not being used on another CPU */
synchronize_irq
(
irq
);
irq_
kfree
(
action
);
kfree
(
action
);
return
0
;
}
printk
(
"Trying to free free IRQ%d
\n
"
,
irq
);
...
...
@@ -229,9 +195,9 @@ int request_irq(unsigned int irq,
return
do_free_irq
(
irq
,
dev_id
);
action
=
(
struct
irqaction
*
)
irq_
kmalloc
(
sizeof
(
struct
irqaction
),
GFP_KERNEL
);
kmalloc
(
sizeof
(
struct
irqaction
),
GFP_KERNEL
);
if
(
!
action
)
{
printk
(
KERN_ERR
"
irq_
kmalloc() failed for irq %d !
\n
"
,
irq
);
printk
(
KERN_ERR
"kmalloc() failed for irq %d !
\n
"
,
irq
);
return
-
ENOMEM
;
}
...
...
arch/ppc64/kernel/open_pic.c
View file @
62d40cef
...
...
@@ -158,7 +158,6 @@ void __init openpic_init_IRQ(void)
openpic_init
(
1
,
NUM_8259_INTERRUPTS
,
chrp_int_ack_special
,
nmi_irq
);
for
(
i
=
0
;
i
<
NUM_8259_INTERRUPTS
;
i
++
)
irq_desc
[
i
].
handler
=
&
i8259_pic
;
i8259_init
();
}
static
inline
u_int
openpic_read
(
volatile
u_int
*
addr
)
...
...
@@ -384,18 +383,30 @@ void __init openpic_init(int main_pic, int offset, unsigned char* chrp_ack,
ppc64_boot_msg
(
0x24
,
"OpenPic Spurious"
);
openpic_set_spurious
(
openpic_vec_spurious
);
/* Initialize the cascade */
if
(
offset
)
{
if
(
request_irq
(
offset
,
no_action
,
SA_INTERRUPT
,
"82c59 cascade"
,
NULL
))
printk
(
KERN_ERR
"Unable to get OpenPIC IRQ 0 for cascade
\n
"
);
}
openpic_set_priority
(
0
);
openpic_disable_8259_pass_through
();
ppc64_boot_msg
(
0x25
,
"OpenPic Done"
);
}
/*
* We cant do this in init_IRQ because we need the memory subsystem up for
* request_irq()
*/
static
int
__init
openpic_setup_i8259
(
void
)
{
if
(
naca
->
interrupt_controller
==
IC_OPEN_PIC
)
{
/* Initialize the cascade */
if
(
request_irq
(
NUM_8259_INTERRUPTS
,
no_action
,
SA_INTERRUPT
,
"82c59 cascade"
,
NULL
))
printk
(
KERN_ERR
"Unable to get OpenPIC IRQ 0 for cascade
\n
"
);
i8259_init
();
}
return
0
;
}
arch_initcall
(
openpic_setup_i8259
);
void
openpic_setup_ISU
(
int
isu_num
,
unsigned
long
addr
)
{
if
(
isu_num
>=
OPENPIC_MAX_ISU
)
...
...
arch/ppc64/kernel/smp.c
View file @
62d40cef
...
...
@@ -208,7 +208,7 @@ smp_openpic_message_pass(int target, int msg, unsigned long data, int wait)
}
}
static
int
__init
smp_
chrp
_probe
(
void
)
static
int
__init
smp_
openpic
_probe
(
void
)
{
int
i
;
int
nr_cpus
=
0
;
...
...
@@ -301,6 +301,10 @@ static int __init smp_xics_probe(void)
if
(
cpu_possible
(
i
))
nr_cpus
++
;
}
#ifdef CONFIG_SMP
extern
void
xics_request_IPIs
(
void
);
xics_request_IPIs
();
#endif
return
nr_cpus
;
}
...
...
@@ -337,7 +341,7 @@ void __init smp_init_pSeries(void)
if
(
naca
->
interrupt_controller
==
IC_OPEN_PIC
)
{
smp_ops
->
message_pass
=
smp_openpic_message_pass
;
smp_ops
->
probe
=
smp_
chrp
_probe
;
smp_ops
->
probe
=
smp_
openpic
_probe
;
}
else
{
smp_ops
->
message_pass
=
smp_xics_message_pass
;
smp_ops
->
probe
=
smp_xics_probe
;
...
...
arch/ppc64/kernel/xics.c
View file @
62d40cef
...
...
@@ -16,6 +16,7 @@
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <linux/signal.h>
#include <linux/init.h>
#include <asm/prom.h>
#include <asm/io.h>
#include <asm/pgtable.h>
...
...
@@ -490,23 +491,38 @@ void xics_init_IRQ(void)
ops
->
cppr_info
(
boot_cpuid
,
0xff
);
iosync
();
if
(
xics_irq_8259_cascade
!=
-
1
)
{
ppc64_boot_msg
(
0x21
,
"XICS Done"
);
}
/*
* We cant do this in init_IRQ because we need the memory subsystem up for
* request_irq()
*/
static
int
__init
xics_setup_i8259
(
void
)
{
if
(
naca
->
interrupt_controller
==
IC_PPC_XIC
&&
xics_irq_8259_cascade
!=
-
1
)
{
if
(
request_irq
(
xics_irq_8259_cascade
+
XICS_IRQ_OFFSET
,
no_action
,
0
,
"8259 cascade"
,
0
))
printk
(
KERN_ERR
"xics_init_IRQ: couldn't get 8259 cascade
\n
"
);
i8259_init
();
}
return
0
;
}
arch_initcall
(
xics_setup_i8259
);
#ifdef CONFIG_SMP
void
xics_request_IPIs
(
void
)
{
real_irq_to_virt_map
[
XICS_IPI
]
=
virt_irq_to_real_map
[
XICS_IPI
]
=
XICS_IPI
;
/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
request_irq
(
XICS_IPI
+
XICS_IRQ_OFFSET
,
xics_ipi_action
,
SA_INTERRUPT
,
"IPI"
,
0
);
irq_desc
[
XICS_IPI
+
XICS_IRQ_OFFSET
].
status
|=
IRQ_PER_CPU
;
#endif
ppc64_boot_msg
(
0x21
,
"XICS Done"
);
}
#endif
void
xics_set_affinity
(
unsigned
int
virq
,
unsigned
long
cpumask
)
{
...
...
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