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
3ba32a67
Commit
3ba32a67
authored
Apr 07, 2003
by
Alan Cox
Committed by
Linus Torvalds
Apr 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix arcnet locking for 2.5
parent
f27dc99e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
drivers/net/arcnet/arcnet.c
drivers/net/arcnet/arcnet.c
+16
-21
No files found.
drivers/net/arcnet/arcnet.c
View file @
3ba32a67
...
...
@@ -80,6 +80,7 @@ struct ArcProto arc_proto_null =
null_prepare_tx
};
static
spinlock_t
arcnet_lock
=
SPIN_LOCK_UNLOCKED
;
/* Exported function prototypes */
int
arcnet_debug
=
ARCNET_DEBUG
;
...
...
@@ -186,10 +187,7 @@ void cleanup_module(void)
void
arcnet_dump_skb
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
,
char
*
desc
)
{
int
i
;
unsigned
long
flags
;
save_flags
(
flags
);
cli
();
printk
(
KERN_DEBUG
"%6s: skb dump (%s) follows:"
,
dev
->
name
,
desc
);
for
(
i
=
0
;
i
<
skb
->
len
;
i
++
)
{
if
(
i
%
16
==
0
)
...
...
@@ -197,7 +195,6 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc)
printk
(
"%02X "
,
((
u_char
*
)
skb
->
data
)[
i
]);
}
printk
(
"
\n
"
);
restore_flags
(
flags
);
}
EXPORT_SYMBOL
(
arcnet_dump_skb
);
...
...
@@ -215,10 +212,11 @@ void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc)
unsigned
long
flags
;
static
uint8_t
buf
[
512
];
save_flags
(
flags
);
cli
();
/* hw.copy_from_card expects IRQ context so take the IRQ lock
to keep it single threaded */
spin_lock_irqsave
(
&
arcnet_lock
,
flags
);
lp
->
hw
.
copy_from_card
(
dev
,
bufnum
,
0
,
buf
,
512
);
spin_unlock_irqrestore
(
&
arcnet_lock
,
flags
);
/* if the offset[0] byte is nonzero, this is a 256-byte packet */
length
=
(
buf
[
2
]
?
256
:
512
);
...
...
@@ -231,7 +229,6 @@ void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc)
}
printk
(
"
\n
"
);
restore_flags
(
flags
);
}
EXPORT_SYMBOL
(
arcnet_dump_packet
);
...
...
@@ -670,9 +667,7 @@ static void arcnet_timeout(struct net_device *dev)
int
status
=
ASTATUS
();
char
*
msg
;
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
arcnet_lock
,
flags
);
if
(
status
&
TXFREEflag
)
{
/* transmit _DID_ finish */
msg
=
" - missed IRQ?"
;
}
else
{
...
...
@@ -687,8 +682,8 @@ static void arcnet_timeout(struct net_device *dev)
AINTMASK
(
0
);
lp
->
intmask
|=
TXFREEflag
;
AINTMASK
(
lp
->
intmask
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
arcnet_lock
,
flags
);
if
(
jiffies
-
lp
->
last_timeout
>
10
*
HZ
)
{
BUGMSG
(
D_EXTRA
,
"tx timed out%s (status=%Xh, intmask=%Xh, dest=%02Xh)
\n
"
,
...
...
@@ -714,17 +709,14 @@ void arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
BUGMSG
(
D_DURING
,
"
\n
"
);
if
(
dev
==
NULL
)
{
BUGMSG
(
D_DURING
,
"arcnet: irq %d for unknown device.
\n
"
,
irq
);
return
;
}
BUGMSG
(
D_DURING
,
"in arcnet_interrupt
\n
"
);
spin_lock
(
&
arcnet_lock
);
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
if
(
!
lp
)
{
BUGMSG
(
D_DURING
,
"arcnet: irq ignored due to missing lp.
\n
"
);
return
;
}
if
(
!
lp
)
BUG
();
/*
* RESET flag was enabled - if device is not running, we must clear it right
* away (but nothing else).
...
...
@@ -733,6 +725,7 @@ void arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if
(
ASTATUS
()
&
RESETflag
)
ACOMMAND
(
CFLAGScmd
|
RESETclear
);
AINTMASK
(
0
);
spin_unlock
(
&
arcnet_lock
);
return
;
}
...
...
@@ -899,6 +892,8 @@ void arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
AINTMASK
(
0
);
udelay
(
1
);
AINTMASK
(
lp
->
intmask
);
spin_unlock
(
&
arcnet_lock
);
}
...
...
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