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
685c21cc
Commit
685c21cc
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] nowayout fixes for wafer5823
parent
ca8ce968
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
drivers/char/watchdog/wafer5823wdt.c
drivers/char/watchdog/wafer5823wdt.c
+32
-5
No files found.
drivers/char/watchdog/wafer5823wdt.c
View file @
685c21cc
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
static
unsigned
long
wafwdt_is_open
;
static
unsigned
long
wafwdt_is_open
;
static
spinlock_t
wafwdt_lock
;
static
spinlock_t
wafwdt_lock
;
static
int
expect_close
=
0
;
/*
/*
* You must set these - there is no sane way to probe for this board.
* You must set these - there is no sane way to probe for this board.
...
@@ -56,6 +57,15 @@ static spinlock_t wafwdt_lock;
...
@@ -56,6 +57,15 @@ static spinlock_t wafwdt_lock;
#define WD_TIMO 60
/* 1 minute */
#define WD_TIMO 60
/* 1 minute */
static
int
wd_margin
=
WD_TIMO
;
static
int
wd_margin
=
WD_TIMO
;
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static
int
nowayout
=
1
;
#else
static
int
nowayout
=
0
;
#endif
MODULE_PARM
(
nowayout
,
"i"
);
MODULE_PARM_DESC
(
nowayout
,
"Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"
);
static
void
wafwdt_ping
(
void
)
static
void
wafwdt_ping
(
void
)
{
{
/* pat watchdog */
/* pat watchdog */
...
@@ -86,6 +96,20 @@ static ssize_t wafwdt_write(struct file *file, const char *buf, size_t count, lo
...
@@ -86,6 +96,20 @@ static ssize_t wafwdt_write(struct file *file, const char *buf, size_t count, lo
return
-
ESPIPE
;
return
-
ESPIPE
;
if
(
count
)
{
if
(
count
)
{
if
(
!
nowayout
)
{
size_t
i
;
/* In case it was set long ago */
expect_close
=
0
;
for
(
i
=
0
;
i
!=
count
;
i
++
)
{
char
c
;
if
(
get_user
(
c
,
buf
+
i
))
return
-
EFAULT
;
if
(
c
==
'V'
)
expect_close
=
1
;
}
}
wafwdt_ping
();
wafwdt_ping
();
return
1
;
return
1
;
}
}
...
@@ -97,8 +121,9 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd
...
@@ -97,8 +121,9 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd
{
{
int
new_margin
;
int
new_margin
;
static
struct
watchdog_info
ident
=
{
static
struct
watchdog_info
ident
=
{
WDIOF_KEEPALIVEPING
|
WDIOF_SETTIMEOUT
,
.
options
=
WDIOF_KEEPALIVEPING
|
WDIOF_SETTIMEOUT
|
WDIOF_MAGICCLOSE
,
1
,
"Wafer 5823 WDT"
.
firmware_version
=
1
,
.
identity
=
"Wafer 5823 WDT"
};
};
int
one
=
1
;
int
one
=
1
;
...
@@ -148,9 +173,11 @@ static int
...
@@ -148,9 +173,11 @@ static int
wafwdt_close
(
struct
inode
*
inode
,
struct
file
*
file
)
wafwdt_close
(
struct
inode
*
inode
,
struct
file
*
file
)
{
{
clear_bit
(
0
,
&
wafwdt_is_open
);
clear_bit
(
0
,
&
wafwdt_is_open
);
#ifndef CONFIG_WATCHDOG_NOWAYOUT
if
(
expect_close
)
{
wafwdt_stop
();
wafwdt_stop
();
#endif
}
else
{
printk
(
KERN_CRIT
"WDT device closed unexpectedly. WDT will not stop!
\n
"
);
}
return
0
;
return
0
;
}
}
...
...
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