mei: me: read H_CSR after asserting reset
authorTomas Winkler <tomas.winkler@intel.com>
Mon, 12 May 2014 09:19:41 +0000 (12:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 01:54:15 +0000 (18:54 -0700)
commit c40765d919d25d2d44d99c4ce39e48808f137e1e upstream.

According the spec the host should read H_CSR again
after asserting reset H_RST to ensure that reset was
read by the firmware

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>
drivers/misc/mei/hw-me.c

index 06311c5ada36e11da983df89274376ac12b0913a..b9ce243788769b3479901c511a869582a844ac30 100644 (file)
@@ -186,7 +186,19 @@ static void mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
        dev->recvd_hw_ready = false;
        mei_me_reg_write(hw, H_CSR, hcsr);
 
-       if (dev->dev_state == MEI_DEV_POWER_DOWN)
+       /*
+        * Host reads the H_CSR once to ensure that the
+        * posted write to H_CSR completes.
+        */
+       hcsr = mei_hcsr_read(hw);
+
+       if ((hcsr & H_RST) == 0)
+               dev_warn(&dev->pdev->dev, "H_RST is not set = 0x%08X", hcsr);
+
+       if ((hcsr & H_RDY) == H_RDY)
+               dev_warn(&dev->pdev->dev, "H_RDY is not cleared 0x%08X", hcsr);
+
+       if (intr_enable == false)
                mei_me_hw_reset_release(dev);
 
        dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", mei_hcsr_read(hw));