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
Kirill Smelkov
linux
Commits
74db1a37
Commit
74db1a37
authored
Oct 09, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] ecard.c: Make the ecard task completion per request.
parent
d28fa03d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
arch/arm/kernel/ecard.c
arch/arm/kernel/ecard.c
+11
-8
No files found.
arch/arm/kernel/ecard.c
View file @
74db1a37
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include <linux/types.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/reboot.h>
#include <linux/reboot.h>
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/slab.h>
...
@@ -65,6 +66,7 @@ struct ecard_request {
...
@@ -65,6 +66,7 @@ struct ecard_request {
unsigned
int
length
;
unsigned
int
length
;
unsigned
int
use_loader
;
unsigned
int
use_loader
;
void
*
buffer
;
void
*
buffer
;
struct
completion
*
complete
;
};
};
struct
expcard_blacklist
{
struct
expcard_blacklist
{
...
@@ -219,12 +221,9 @@ static void ecard_do_request(struct ecard_request *req)
...
@@ -219,12 +221,9 @@ static void ecard_do_request(struct ecard_request *req)
}
}
}
}
#include <linux/completion.h>
static
DECLARE_WAIT_QUEUE_HEAD
(
ecard_wait
);
static
DECLARE_WAIT_QUEUE_HEAD
(
ecard_wait
);
static
struct
ecard_request
*
ecard_req
;
static
struct
ecard_request
*
ecard_req
;
static
DECLARE_MUTEX
(
ecard_sem
);
static
DECLARE_MUTEX
(
ecard_sem
);
static
DECLARE_COMPLETION
(
ecard_completion
);
/*
/*
* Set up the expansion card daemon's page tables.
* Set up the expansion card daemon's page tables.
...
@@ -298,9 +297,10 @@ ecard_task(void * unused)
...
@@ -298,9 +297,10 @@ ecard_task(void * unused)
wait_event_interruptible
(
ecard_wait
,
ecard_req
!=
NULL
);
wait_event_interruptible
(
ecard_wait
,
ecard_req
!=
NULL
);
req
=
xchg
(
&
ecard_req
,
NULL
);
req
=
xchg
(
&
ecard_req
,
NULL
);
if
(
req
!=
NULL
)
if
(
req
!=
NULL
)
{
ecard_do_request
(
req
);
ecard_do_request
(
req
);
complete
(
&
ecard_completion
);
complete
(
req
->
complete
);
}
}
}
}
}
...
@@ -310,15 +310,18 @@ ecard_task(void * unused)
...
@@ -310,15 +310,18 @@ ecard_task(void * unused)
* FIXME: The test here is not sufficient to detect if the
* FIXME: The test here is not sufficient to detect if the
* kcardd is running.
* kcardd is running.
*/
*/
static
void
static
void
ecard_call
(
struct
ecard_request
*
req
)
ecard_call
(
struct
ecard_request
*
req
)
{
{
DECLARE_COMPLETION
(
completion
);
/*
/*
* Make sure we have a context that is able to sleep.
* Make sure we have a context that is able to sleep.
*/
*/
if
(
current
==
&
init_task
||
in_interrupt
())
if
(
current
==
&
init_task
||
in_interrupt
())
BUG
();
BUG
();
req
->
complete
=
&
completion
;
down
(
&
ecard_sem
);
down
(
&
ecard_sem
);
ecard_req
=
req
;
ecard_req
=
req
;
wake_up
(
&
ecard_wait
);
wake_up
(
&
ecard_wait
);
...
@@ -326,7 +329,7 @@ ecard_call(struct ecard_request *req)
...
@@ -326,7 +329,7 @@ ecard_call(struct ecard_request *req)
/*
/*
* Now wait for kecardd to run.
* Now wait for kecardd to run.
*/
*/
wait_for_completion
(
&
ecard_
completion
);
wait_for_completion
(
&
completion
);
up
(
&
ecard_sem
);
up
(
&
ecard_sem
);
}
}
...
...
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