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
b045cc61
Commit
b045cc61
authored
Jan 10, 2003
by
Dave Jones
Committed by
Dave Jones
Jan 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WATCHDOG] mixcomwd nowayout fixes from 2.4
parent
44342733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
drivers/char/watchdog/mixcomwd.c
drivers/char/watchdog/mixcomwd.c
+23
-4
No files found.
drivers/char/watchdog/mixcomwd.c
View file @
b045cc61
...
@@ -62,6 +62,7 @@ static long mixcomwd_opened; /* long req'd for setbit --RR */
...
@@ -62,6 +62,7 @@ static long mixcomwd_opened; /* long req'd for setbit --RR */
static
int
watchdog_port
;
static
int
watchdog_port
;
static
int
mixcomwd_timer_alive
;
static
int
mixcomwd_timer_alive
;
static
struct
timer_list
mixcomwd_timer
=
TIMER_INITIALIZER
(
NULL
,
0
,
0
);
static
struct
timer_list
mixcomwd_timer
=
TIMER_INITIALIZER
(
NULL
,
0
,
0
);
static
int
expect_close
=
0
;
#ifdef CONFIG_WATCHDOG_NOWAYOUT
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static
int
nowayout
=
1
;
static
int
nowayout
=
1
;
...
@@ -109,8 +110,7 @@ static int mixcomwd_open(struct inode *inode, struct file *file)
...
@@ -109,8 +110,7 @@ static int mixcomwd_open(struct inode *inode, struct file *file)
static
int
mixcomwd_release
(
struct
inode
*
inode
,
struct
file
*
file
)
static
int
mixcomwd_release
(
struct
inode
*
inode
,
struct
file
*
file
)
{
{
if
(
expect_close
)
{
if
(
!
nowayout
)
{
if
(
mixcomwd_timer_alive
)
{
if
(
mixcomwd_timer_alive
)
{
printk
(
KERN_ERR
"mixcomwd: release called while internal timer alive"
);
printk
(
KERN_ERR
"mixcomwd: release called while internal timer alive"
);
return
-
EBUSY
;
return
-
EBUSY
;
...
@@ -121,7 +121,10 @@ static int mixcomwd_release(struct inode *inode, struct file *file)
...
@@ -121,7 +121,10 @@ static int mixcomwd_release(struct inode *inode, struct file *file)
mixcomwd_timer
.
data
=
0
;
mixcomwd_timer
.
data
=
0
;
mixcomwd_timer_alive
=
1
;
mixcomwd_timer_alive
=
1
;
add_timer
(
&
mixcomwd_timer
);
add_timer
(
&
mixcomwd_timer
);
}
else
{
printk
(
KERN_CRIT
"mixcomwd: WDT device closed unexpectedly. WDT will not stop!
\n
"
);
}
}
clear_bit
(
0
,
&
mixcomwd_opened
);
clear_bit
(
0
,
&
mixcomwd_opened
);
return
0
;
return
0
;
}
}
...
@@ -135,6 +138,20 @@ static ssize_t mixcomwd_write(struct file *file, const char *data, size_t len, l
...
@@ -135,6 +138,20 @@ static ssize_t mixcomwd_write(struct file *file, const char *data, size_t len, l
if
(
len
)
if
(
len
)
{
{
if
(
!
nowayout
)
{
size_t
i
;
/* In case it was set long ago */
expect_close
=
0
;
for
(
i
=
0
;
i
!=
len
;
i
++
)
{
char
c
;
if
(
get_user
(
c
,
data
+
i
))
return
-
EFAULT
;
if
(
c
==
'V'
)
expect_close
=
1
;
}
}
mixcomwd_ping
();
mixcomwd_ping
();
return
1
;
return
1
;
}
}
...
@@ -145,8 +162,10 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
...
@@ -145,8 +162,10 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
unsigned
int
cmd
,
unsigned
long
arg
)
unsigned
int
cmd
,
unsigned
long
arg
)
{
{
int
status
;
int
status
;
static
struct
watchdog_info
ident
=
{
static
struct
watchdog_info
ident
=
{
WDIOF_KEEPALIVEPING
,
1
,
"MixCOM watchdog"
.
options
=
WDIOF_KEEPALIVEPING
|
WDIOF_MAGICCLOSE
,
.
firmware_version
=
1
,
.
identity
=
"MixCOM watchdog"
};
};
switch
(
cmd
)
switch
(
cmd
)
...
...
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