Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142517
b: refs/heads/master
c: b6966b1
h: refs/heads/master
i:
  142515: c7c564d
v: v3
  • Loading branch information
Mark Nelson authored and Paul Mackerras committed Apr 7, 2009
1 parent d9ca7a2 commit 02f2640
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae6e59caefd8d4097ccb096c95df95ec7e52fe88
refs/heads/master: b6966b1be568e83a48585369731f1123a6f85157
13 changes: 11 additions & 2 deletions trunk/drivers/watchdog/wdrtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ static int wdrtas_set_interval(int interval)
return result;
}

#define WDRTAS_SP_SPI_LEN 4

/**
* wdrtas_get_interval - returns the current watchdog interval
* @fallback_value: value (in seconds) to use, if the RTAS call fails
Expand All @@ -119,10 +121,17 @@ static int wdrtas_set_interval(int interval)
static int wdrtas_get_interval(int fallback_value)
{
long result;
char value[4];
char value[WDRTAS_SP_SPI_LEN];

spin_lock(&rtas_data_buf_lock);
memset(rtas_data_buf, 0, WDRTAS_SP_SPI_LEN);
result = rtas_call(wdrtas_token_get_sp, 3, 1, NULL,
WDRTAS_SP_SPI, (void *)__pa(&value), 4);
WDRTAS_SP_SPI, __pa(rtas_data_buf),
WDRTAS_SP_SPI_LEN);

memcpy(value, rtas_data_buf, WDRTAS_SP_SPI_LEN);
spin_unlock(&rtas_data_buf_lock);

if (value[0] != 0 || value[1] != 2 || value[3] != 0 || result < 0) {
printk(KERN_WARNING "wdrtas: could not get sp_spi watchdog "
"timeout (%li). Continuing\n", result);
Expand Down

0 comments on commit 02f2640

Please sign in to comment.