diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-01-08 22:07:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-09 01:40:47 +0100 |
commit | 115ba28c5e075c6bffd8106a2b5e23db88d0c3b5 (patch) | |
tree | 20e0f51fbbc9669f960e40ddc443fa2a4e3a4f56 /drivers/misc/mei/interrupt.c | |
parent | mei: use non cached hcsr for interrupt enablement (diff) | |
download | linux-115ba28c5e075c6bffd8106a2b5e23db88d0c3b5.tar.xz linux-115ba28c5e075c6bffd8106a2b5e23db88d0c3b5.zip |
mei: abstract host and device readieness
Add mei_host_set_ready function to enable the device
and is_ready function to query the host and me readiness
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/interrupt.c')
-rw-r--r-- | drivers/misc/mei/interrupt.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index d7e1b797e87b..27374b6b6424 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -700,7 +700,7 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id) dev->me_hw_state = mei_mecsr_read(dev); /* check if ME wants a reset */ - if ((dev->me_hw_state & ME_RDY_HRA) == 0 && + if (!mei_me_is_ready(dev) && dev->dev_state != MEI_DEV_RESETING && dev->dev_state != MEI_DEV_INITIALIZING) { dev_dbg(&dev->pdev->dev, "FW not ready.\n"); @@ -711,16 +711,17 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id) dev->host_hw_state = mei_hcsr_read(dev); /* check if we need to start the dev */ - if ((dev->host_hw_state & H_RDY) == 0) { - if ((dev->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA) { + if (!mei_host_is_ready(dev)) { + if (mei_me_is_ready(dev)) { dev_dbg(&dev->pdev->dev, "we need to start the dev.\n"); - dev->host_hw_state |= (H_IE | H_IG | H_RDY); - mei_hcsr_set(dev); - dev->dev_state = MEI_DEV_INIT_CLIENTS; + + mei_host_set_ready(dev); + dev_dbg(&dev->pdev->dev, "link is established start sending messages.\n"); - /* link is established - * start sending messages. - */ + /* link is established * start sending messages. */ + + dev->dev_state = MEI_DEV_INIT_CLIENTS; + mei_hbm_start_req(dev); mutex_unlock(&dev->device_lock); return IRQ_HANDLED; |