diff options
| author | Xu Wang <gesaint@linux.vnet.ibm.com> | 2015-03-06 03:26:30 -0500 |
|---|---|---|
| committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-03-25 06:49:42 -0400 |
| commit | b2527d2009903a06b0076bb89166c72a0f17823b (patch) | |
| tree | ad0359db4ec691b3d237cdb47b65b84d330e90b9 /drivers/watchdog | |
| parent | 9ec6cb80c8752db70174d3f67d33243fbab05014 (diff) | |
s390/watchdog: support for KVM hypervisors and delete pr_info messages
This patch extends the diag288 watchdog driver to be able to deal with KVM
hypervisors. Only z/VM needs special handling, we can use the same interface
as on LPAR. Remove all pr_info output to avoid misconception. Because there
is no value in these messages and only the pr_err messages make sense.
Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/watchdog')
| -rw-r--r-- | drivers/watchdog/diag288_wdt.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/watchdog/diag288_wdt.c b/drivers/watchdog/diag288_wdt.c index 480cedd41d09..a9a5210143ae 100644 --- a/drivers/watchdog/diag288_wdt.c +++ b/drivers/watchdog/diag288_wdt.c | |||
| @@ -125,9 +125,7 @@ static int wdt_start(struct watchdog_device *dev) | |||
| 125 | ret = __diag288_vm(func, dev->timeout, ebc_cmd, len); | 125 | ret = __diag288_vm(func, dev->timeout, ebc_cmd, len); |
| 126 | WARN_ON(ret != 0); | 126 | WARN_ON(ret != 0); |
| 127 | kfree(ebc_cmd); | 127 | kfree(ebc_cmd); |
| 128 | } | 128 | } else { |
| 129 | |||
| 130 | if (MACHINE_IS_LPAR) { | ||
| 131 | ret = __diag288_lpar(WDT_FUNC_INIT, | 129 | ret = __diag288_lpar(WDT_FUNC_INIT, |
| 132 | dev->timeout, LPARWDT_RESTART); | 130 | dev->timeout, LPARWDT_RESTART); |
| 133 | } | 131 | } |
| @@ -136,7 +134,6 @@ static int wdt_start(struct watchdog_device *dev) | |||
| 136 | pr_err("The watchdog cannot be activated\n"); | 134 | pr_err("The watchdog cannot be activated\n"); |
| 137 | return ret; | 135 | return ret; |
| 138 | } | 136 | } |
| 139 | pr_info("The watchdog was activated\n"); | ||
| 140 | return 0; | 137 | return 0; |
| 141 | } | 138 | } |
| 142 | 139 | ||
| @@ -145,7 +142,6 @@ static int wdt_stop(struct watchdog_device *dev) | |||
| 145 | int ret; | 142 | int ret; |
| 146 | 143 | ||
| 147 | ret = __diag288(WDT_FUNC_CANCEL, 0, 0, 0); | 144 | ret = __diag288(WDT_FUNC_CANCEL, 0, 0, 0); |
| 148 | pr_info("The watchdog was deactivated\n"); | ||
| 149 | return ret; | 145 | return ret; |
| 150 | } | 146 | } |
| 151 | 147 | ||
| @@ -177,10 +173,9 @@ static int wdt_ping(struct watchdog_device *dev) | |||
| 177 | ret = __diag288_vm(func, dev->timeout, ebc_cmd, len); | 173 | ret = __diag288_vm(func, dev->timeout, ebc_cmd, len); |
| 178 | WARN_ON(ret != 0); | 174 | WARN_ON(ret != 0); |
| 179 | kfree(ebc_cmd); | 175 | kfree(ebc_cmd); |
| 180 | } | 176 | } else { |
| 181 | |||
| 182 | if (MACHINE_IS_LPAR) | ||
| 183 | ret = __diag288_lpar(WDT_FUNC_CHANGE, dev->timeout, 0); | 177 | ret = __diag288_lpar(WDT_FUNC_CHANGE, dev->timeout, 0); |
| 178 | } | ||
| 184 | 179 | ||
| 185 | if (ret) | 180 | if (ret) |
| 186 | pr_err("The watchdog timer cannot be started or reset\n"); | 181 | pr_err("The watchdog timer cannot be started or reset\n"); |
| @@ -273,21 +268,16 @@ static int __init diag288_init(void) | |||
| 273 | watchdog_set_nowayout(&wdt_dev, nowayout_info); | 268 | watchdog_set_nowayout(&wdt_dev, nowayout_info); |
| 274 | 269 | ||
| 275 | if (MACHINE_IS_VM) { | 270 | if (MACHINE_IS_VM) { |
| 276 | pr_info("The watchdog device driver detected a z/VM environment\n"); | ||
| 277 | if (__diag288_vm(WDT_FUNC_INIT, 15, | 271 | if (__diag288_vm(WDT_FUNC_INIT, 15, |
| 278 | ebc_begin, sizeof(ebc_begin)) != 0) { | 272 | ebc_begin, sizeof(ebc_begin)) != 0) { |
| 279 | pr_err("The watchdog cannot be initialized\n"); | 273 | pr_err("The watchdog cannot be initialized\n"); |
| 280 | return -EINVAL; | 274 | return -EINVAL; |
| 281 | } | 275 | } |
| 282 | } else if (MACHINE_IS_LPAR) { | 276 | } else { |
| 283 | pr_info("The watchdog device driver detected an LPAR environment\n"); | ||
| 284 | if (__diag288_lpar(WDT_FUNC_INIT, 30, LPARWDT_RESTART)) { | 277 | if (__diag288_lpar(WDT_FUNC_INIT, 30, LPARWDT_RESTART)) { |
| 285 | pr_err("The watchdog cannot be initialized\n"); | 278 | pr_err("The watchdog cannot be initialized\n"); |
| 286 | return -EINVAL; | 279 | return -EINVAL; |
| 287 | } | 280 | } |
| 288 | } else { | ||
| 289 | pr_err("Linux runs in an environment that does not support the diag288 watchdog\n"); | ||
| 290 | return -ENODEV; | ||
| 291 | } | 281 | } |
| 292 | 282 | ||
| 293 | if (__diag288_lpar(WDT_FUNC_CANCEL, 0, 0)) { | 283 | if (__diag288_lpar(WDT_FUNC_CANCEL, 0, 0)) { |
