Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2527d20 authored by Xu Wang's avatar Xu Wang Committed by Martin Schwidefsky
Browse files

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: default avatarXu Wang <gesaint@linux.vnet.ibm.com>
Reviewed-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9ec6cb80
Loading
Loading
Loading
Loading
+4 −14
Original line number Original line Diff line number Diff line
@@ -125,9 +125,7 @@ static int wdt_start(struct watchdog_device *dev)
		ret = __diag288_vm(func, dev->timeout, ebc_cmd, len);
		ret = __diag288_vm(func, dev->timeout, ebc_cmd, len);
		WARN_ON(ret != 0);
		WARN_ON(ret != 0);
		kfree(ebc_cmd);
		kfree(ebc_cmd);
	}
	} else {

	if (MACHINE_IS_LPAR) {
		ret = __diag288_lpar(WDT_FUNC_INIT,
		ret = __diag288_lpar(WDT_FUNC_INIT,
				     dev->timeout, LPARWDT_RESTART);
				     dev->timeout, LPARWDT_RESTART);
	}
	}
@@ -136,7 +134,6 @@ static int wdt_start(struct watchdog_device *dev)
		pr_err("The watchdog cannot be activated\n");
		pr_err("The watchdog cannot be activated\n");
		return ret;
		return ret;
	}
	}
	pr_info("The watchdog was activated\n");
	return 0;
	return 0;
}
}


@@ -145,7 +142,6 @@ static int wdt_stop(struct watchdog_device *dev)
	int ret;
	int ret;


	ret = __diag288(WDT_FUNC_CANCEL, 0, 0, 0);
	ret = __diag288(WDT_FUNC_CANCEL, 0, 0, 0);
	pr_info("The watchdog was deactivated\n");
	return ret;
	return ret;
}
}


@@ -177,10 +173,9 @@ static int wdt_ping(struct watchdog_device *dev)
		ret = __diag288_vm(func, dev->timeout, ebc_cmd, len);
		ret = __diag288_vm(func, dev->timeout, ebc_cmd, len);
		WARN_ON(ret != 0);
		WARN_ON(ret != 0);
		kfree(ebc_cmd);
		kfree(ebc_cmd);
	}
	} else {

	if (MACHINE_IS_LPAR)
		ret = __diag288_lpar(WDT_FUNC_CHANGE, dev->timeout, 0);
		ret = __diag288_lpar(WDT_FUNC_CHANGE, dev->timeout, 0);
	}


	if (ret)
	if (ret)
		pr_err("The watchdog timer cannot be started or reset\n");
		pr_err("The watchdog timer cannot be started or reset\n");
@@ -273,21 +268,16 @@ static int __init diag288_init(void)
	watchdog_set_nowayout(&wdt_dev, nowayout_info);
	watchdog_set_nowayout(&wdt_dev, nowayout_info);


	if (MACHINE_IS_VM) {
	if (MACHINE_IS_VM) {
		pr_info("The watchdog device driver detected a z/VM environment\n");
		if (__diag288_vm(WDT_FUNC_INIT, 15,
		if (__diag288_vm(WDT_FUNC_INIT, 15,
				 ebc_begin, sizeof(ebc_begin)) != 0) {
				 ebc_begin, sizeof(ebc_begin)) != 0) {
			pr_err("The watchdog cannot be initialized\n");
			pr_err("The watchdog cannot be initialized\n");
			return -EINVAL;
			return -EINVAL;
		}
		}
	} else if (MACHINE_IS_LPAR) {
	} else {
		pr_info("The watchdog device driver detected an LPAR environment\n");
		if (__diag288_lpar(WDT_FUNC_INIT, 30, LPARWDT_RESTART)) {
		if (__diag288_lpar(WDT_FUNC_INIT, 30, LPARWDT_RESTART)) {
			pr_err("The watchdog cannot be initialized\n");
			pr_err("The watchdog cannot be initialized\n");
			return -EINVAL;
			return -EINVAL;
		}
		}
	} else {
		pr_err("Linux runs in an environment that does not support the diag288 watchdog\n");
		return -ENODEV;
	}
	}


	if (__diag288_lpar(WDT_FUNC_CANCEL, 0, 0)) {
	if (__diag288_lpar(WDT_FUNC_CANCEL, 0, 0)) {