diff options
author | Oren Weil <oren.jer.weil@intel.com> | 2011-09-07 09:03:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-09 13:28:20 -0700 |
commit | 617aa39639943626fa262757d176be413c54571b (patch) | |
tree | 883a42d111db684ffd1123df9688ab7b0bc0e160 | |
parent | f6c39d4f2d350df049a844b658eb6b08c5833e51 (diff) |
staging: mei: removing dependency between WD and AMTHI init function.
AMTHI need to be initialized after WD Client was initialized, moving the AMTHI outside
of the WD initialization function.
in order to remove the coupling between the initialization of those clients.
AMTHI is getting initialized (getting connected to the FW feature/client) in two ways:
1) if mei driver fails to send connect message to watchdog client (WD initialization), then
immediately the AMTHI client getting initialized right after the watchdog initialization function.
2) if Watchdog client success to send connect message to watchdog client, then only after
the driver is getting the connect response message the AMTHI client is getting initialized
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/mei/init.c | 8 | ||||
-rw-r--r-- | drivers/staging/mei/interface.h | 2 | ||||
-rw-r--r-- | drivers/staging/mei/wd.c | 16 |
3 files changed, 20 insertions, 6 deletions
diff --git a/drivers/staging/mei/init.c b/drivers/staging/mei/init.c index 0fa8216fd0eb..69a57e77a09d 100644 --- a/drivers/staging/mei/init.c +++ b/drivers/staging/mei/init.c @@ -521,7 +521,13 @@ void mei_host_client_properties(struct mei_device *dev) bitmap_set(dev->host_clients_map, 0, 3); dev->mei_state = MEI_ENABLED; - mei_wd_host_init(dev); + /* if wd initialization fails, initialization the AMTHI client, + * otherwise the AMTHI client will be initialized after the WD client connect response + * will be received + */ + if (mei_wd_host_init(dev)) + mei_host_init_iamthif(dev); + return; } diff --git a/drivers/staging/mei/interface.h b/drivers/staging/mei/interface.h index d0bf5cf4f3ec..7bcf0966030a 100644 --- a/drivers/staging/mei/interface.h +++ b/drivers/staging/mei/interface.h @@ -48,7 +48,7 @@ int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl); int mei_wd_send(struct mei_device *dev); int mei_wd_stop(struct mei_device *dev, bool preserve); -void mei_wd_host_init(struct mei_device *dev); +bool mei_wd_host_init(struct mei_device *dev); void mei_wd_start_setup(struct mei_device *dev); int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl); diff --git a/drivers/staging/mei/wd.c b/drivers/staging/mei/wd.c index 42f04efc90e4..721487d05ba8 100644 --- a/drivers/staging/mei/wd.c +++ b/drivers/staging/mei/wd.c @@ -63,8 +63,10 @@ void mei_wd_start_setup(struct mei_device *dev) * * @dev: the device structure */ -void mei_wd_host_init(struct mei_device *dev) +bool mei_wd_host_init(struct mei_device *dev) { + bool ret = false; + mei_cl_init(&dev->wd_cl, dev); /* look for WD client and connect to it */ @@ -83,19 +85,25 @@ void mei_wd_host_init(struct mei_device *dev) dev_dbg(&dev->pdev->dev, "Failed to connect to WD client\n"); dev->wd_cl.state = MEI_FILE_DISCONNECTED; dev->wd_cl.host_client_id = 0; - mei_host_init_iamthif(dev) ; + ret = false; + goto end; } else { dev->wd_cl.timer_count = CONNECT_TIMEOUT; } } else { dev_dbg(&dev->pdev->dev, "Failed to find WD client\n"); - mei_host_init_iamthif(dev) ; + ret = false; + goto end; } } else { dev->wd_bypass = true; dev_dbg(&dev->pdev->dev, "WD requested to be disabled\n"); - mei_host_init_iamthif(dev) ; + ret = false; + goto end; } + +end: + return ret; } /** |