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
641f8791
Commit
641f8791
authored
Jan 27, 2007
by
Stefan Richter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewire: use atomic type for fw_device.state
Signed-off-by:
Stefan Richter
<
stefanr@s5r6.in-berlin.de
>
parent
0edeefd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
drivers/firewire/fw-card.c
drivers/firewire/fw-card.c
+1
-1
drivers/firewire/fw-device.c
drivers/firewire/fw-device.c
+3
-3
drivers/firewire/fw-device.h
drivers/firewire/fw-device.h
+2
-1
No files found.
drivers/firewire/fw-card.c
View file @
641f8791
...
@@ -302,7 +302,7 @@ fw_card_bm_work(struct work_struct *work)
...
@@ -302,7 +302,7 @@ fw_card_bm_work(struct work_struct *work)
/* Either link_on is false, or we failed to read the
/* Either link_on is false, or we failed to read the
* config rom. In either case, pick another root. */
* config rom. In either case, pick another root. */
new_root_id
=
card
->
local_node
->
node_id
;
new_root_id
=
card
->
local_node
->
node_id
;
}
else
if
(
root
->
state
!=
FW_DEVICE_RUNNING
)
{
}
else
if
(
atomic_read
(
&
root
->
state
)
!=
FW_DEVICE_RUNNING
)
{
/* If we haven't probed this device yet, bail out now
/* If we haven't probed this device yet, bail out now
* and let's try again once that's done. */
* and let's try again once that's done. */
spin_unlock_irqrestore
(
&
card
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
card
->
lock
,
flags
);
...
...
drivers/firewire/fw-device.c
View file @
641f8791
...
@@ -494,7 +494,7 @@ static void fw_device_init(struct work_struct *work)
...
@@ -494,7 +494,7 @@ static void fw_device_init(struct work_struct *work)
* necessary. We have to use the atomic cmpxchg here to avoid
* necessary. We have to use the atomic cmpxchg here to avoid
* racing with the FW_NODE_DESTROYED case in
* racing with the FW_NODE_DESTROYED case in
* fw_node_event(). */
* fw_node_event(). */
if
(
cmpxchg
(
&
device
->
state
,
if
(
atomic_
cmpxchg
(
&
device
->
state
,
FW_DEVICE_INITIALIZING
,
FW_DEVICE_INITIALIZING
,
FW_DEVICE_RUNNING
)
==
FW_DEVICE_SHUTDOWN
)
FW_DEVICE_RUNNING
)
==
FW_DEVICE_SHUTDOWN
)
fw_device_shutdown
(
&
device
->
work
.
work
);
fw_device_shutdown
(
&
device
->
work
.
work
);
...
@@ -551,7 +551,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
...
@@ -551,7 +551,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
* device_for_each_child() in FW_NODE_UPDATED is
* device_for_each_child() in FW_NODE_UPDATED is
* doesn't freak out. */
* doesn't freak out. */
device_initialize
(
&
device
->
device
);
device_initialize
(
&
device
->
device
);
device
->
state
=
FW_DEVICE_INITIALIZING
;
atomic_set
(
&
device
->
state
,
FW_DEVICE_INITIALIZING
)
;
device
->
card
=
fw_card_get
(
card
);
device
->
card
=
fw_card_get
(
card
);
device
->
node
=
fw_node_get
(
node
);
device
->
node
=
fw_node_get
(
node
);
device
->
node_id
=
node
->
node_id
;
device
->
node_id
=
node
->
node_id
;
...
@@ -596,7 +596,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
...
@@ -596,7 +596,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
* the device in shutdown state to have that code fail
* the device in shutdown state to have that code fail
* to create the device. */
* to create the device. */
device
=
node
->
data
;
device
=
node
->
data
;
if
(
xchg
(
&
device
->
state
,
if
(
atomic_
xchg
(
&
device
->
state
,
FW_DEVICE_SHUTDOWN
)
==
FW_DEVICE_RUNNING
)
{
FW_DEVICE_SHUTDOWN
)
==
FW_DEVICE_RUNNING
)
{
INIT_DELAYED_WORK
(
&
device
->
work
,
fw_device_shutdown
);
INIT_DELAYED_WORK
(
&
device
->
work
,
fw_device_shutdown
);
schedule_delayed_work
(
&
device
->
work
,
0
);
schedule_delayed_work
(
&
device
->
work
,
0
);
...
...
drivers/firewire/fw-device.h
View file @
641f8791
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/cdev.h>
#include <asm/atomic.h>
enum
fw_device_state
{
enum
fw_device_state
{
FW_DEVICE_INITIALIZING
,
FW_DEVICE_INITIALIZING
,
...
@@ -32,7 +33,7 @@ enum fw_device_state {
...
@@ -32,7 +33,7 @@ enum fw_device_state {
};
};
struct
fw_device
{
struct
fw_device
{
in
t
state
;
atomic_
t
state
;
struct
fw_node
*
node
;
struct
fw_node
*
node
;
int
node_id
;
int
node_id
;
int
generation
;
int
generation
;
...
...
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