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
e7d9aa2a
Commit
e7d9aa2a
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] indydog nowayout fixes from 2.4
parent
a1da6411
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
16 deletions
+43
-16
drivers/char/watchdog/indydog.c
drivers/char/watchdog/indydog.c
+43
-16
No files found.
drivers/char/watchdog/indydog.c
View file @
e7d9aa2a
...
...
@@ -26,6 +26,16 @@
static
unsigned
long
indydog_alive
;
static
struct
sgimc_misc_ctrl
*
mcmisc_regs
;
static
int
expect_close
=
0
;
#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
indydog_ping
()
{
...
...
@@ -43,9 +53,10 @@ static int indydog_open(struct inode *inode, struct file *file)
if
(
test_and_set_bit
(
0
,
&
indydog_alive
)
)
return
-
EBUSY
;
#ifdef CONFIG_WATCHDOG_NOWAYOUT
if
(
nowayout
)
MOD_INC_USE_COUNT
;
#endif
/*
* Activate timer
*/
...
...
@@ -63,16 +74,17 @@ static int indydog_release(struct inode *inode, struct file *file)
{
/*
* Shut off the timer.
* Lock it in if it's a module and we
defined ...NOWAYOUT
* Lock it in if it's a module and we
set nowayout
*/
#ifndef CONFIG_WATCHDOG_NOWAYOUT
{
if
(
expect_close
)
{
u32
mc_ctrl0
=
mcmisc_regs
->
cpuctrl0
;
mc_ctrl0
&=
~
SGIMC_CCTRL0_WDOG
;
mcmisc_regs
->
cpuctrl0
=
mc_ctrl0
;
printk
(
"Stopped watchdog timer.
\n
"
);
}
else
{
printk
(
KERN_CRIT
"WDT device closed unexpectedly. WDT will not stop!
\n
"
);
}
#endif
clear_bit
(
0
,
&
indydog_alive
);
return
0
;
}
...
...
@@ -83,10 +95,23 @@ static ssize_t indydog_write(struct file *file, const char *data, size_t len, lo
if
(
ppos
!=
&
file
->
f_pos
)
return
-
ESPIPE
;
/*
* Refresh the timer.
*/
if
(
len
)
{
/* Refresh the timer. */
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
;
}
}
indydog_ping
();
return
1
;
}
...
...
@@ -97,8 +122,10 @@ static int indydog_ioctl(struct inode *inode, struct file *file,
unsigned
int
cmd
,
unsigned
long
arg
)
{
static
struct
watchdog_info
ident
=
{
identity:
"Hardware Watchdog for SGI IP22"
,
.
options
=
WDIOF_MAGICCLOSE
,
.
identity
=
"Hardware Watchdog for SGI IP22"
,
};
switch
(
cmd
)
{
default:
return
-
ENOIOCTLCMD
;
...
...
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