aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2016-02-07 15:46:50 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 16:00:52 -0500
commit3a20a5c339cce042e53557be067e121e4e984adf (patch)
treecfa121661e5c9b81fe6b98ebfef8e554b1a8c570
parentad1cd720b18330599a9cabaf970095b74c9c3355 (diff)
watchdog: mei_wdt: re-register device on event
For Intel SKL platform the ME device can inform the host via asynchronous notification that the watchdog feature was activated on the device. The activation doesn't require reboot. In that case the driver registers the watchdog device with the kernel. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/watchdog/mei_wdt.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
index b93474ec34a1..630bd189f167 100644
--- a/drivers/watchdog/mei_wdt.c
+++ b/drivers/watchdog/mei_wdt.c
@@ -481,6 +481,21 @@ out:
481 complete(&wdt->response); 481 complete(&wdt->response);
482} 482}
483 483
484/*
485 * mei_wdt_notify_event - callback for event notification
486 *
487 * @cldev: bus device
488 */
489static void mei_wdt_notify_event(struct mei_cl_device *cldev)
490{
491 struct mei_wdt *wdt = mei_cldev_get_drvdata(cldev);
492
493 if (wdt->state != MEI_WDT_NOT_REQUIRED)
494 return;
495
496 mei_wdt_register(wdt);
497}
498
484/** 499/**
485 * mei_wdt_event - callback for event receive 500 * mei_wdt_event - callback for event receive
486 * 501 *
@@ -493,6 +508,9 @@ static void mei_wdt_event(struct mei_cl_device *cldev,
493{ 508{
494 if (events & BIT(MEI_CL_EVENT_RX)) 509 if (events & BIT(MEI_CL_EVENT_RX))
495 mei_wdt_event_rx(cldev); 510 mei_wdt_event_rx(cldev);
511
512 if (events & BIT(MEI_CL_EVENT_NOTIF))
513 mei_wdt_notify_event(cldev);
496} 514}
497 515
498#if IS_ENABLED(CONFIG_DEBUG_FS) 516#if IS_ENABLED(CONFIG_DEBUG_FS)
@@ -605,9 +623,15 @@ static int mei_wdt_probe(struct mei_cl_device *cldev,
605 goto err_out; 623 goto err_out;
606 } 624 }
607 625
608 ret = mei_cldev_register_event_cb(wdt->cldev, BIT(MEI_CL_EVENT_RX), 626 ret = mei_cldev_register_event_cb(wdt->cldev,
627 BIT(MEI_CL_EVENT_RX) |
628 BIT(MEI_CL_EVENT_NOTIF),
609 mei_wdt_event, NULL); 629 mei_wdt_event, NULL);
610 if (ret) { 630
631 /* on legacy devices notification is not supported
632 * this doesn't fail the registration for RX event
633 */
634 if (ret && ret != -EOPNOTSUPP) {
611 dev_err(&cldev->dev, "Could not register event ret=%d\n", ret); 635 dev_err(&cldev->dev, "Could not register event ret=%d\n", ret);
612 goto err_disable; 636 goto err_disable;
613 } 637 }