]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mei: me: generate an interrupt if the hw indicates reset.
authorAlexander Usyskin <alexander.usyskin@intel.com>
Thu, 2 Feb 2017 09:26:54 +0000 (11:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2017 10:49:06 +0000 (11:49 +0100)
In rare case the driver may lose connection with the device after device
reset due to a missed interrupt. The driver will unlock the flow by
generating an interrupt towards the firmware (HIG) when the device is in
the resetting state. The FW is able to ignore the interrupt during
orderly flow. The effected platforms are skylake and newer.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/hw-me.c

index 23294b845c428750030951ff38c55ec604267eb0..71216affcab1f349aafa2c8e8d69507445b213d8 100644 (file)
@@ -393,6 +393,19 @@ static bool mei_me_hw_is_ready(struct mei_device *dev)
        return (mecsr & ME_RDY_HRA) == ME_RDY_HRA;
 }
 
+/**
+ * mei_me_hw_is_resetting - check whether the me(hw) is in reset
+ *
+ * @dev: mei device
+ * Return: bool
+ */
+static bool mei_me_hw_is_resetting(struct mei_device *dev)
+{
+       u32 mecsr = mei_me_mecsr_read(dev);
+
+       return (mecsr & ME_RST_HRA) == ME_RST_HRA;
+}
+
 /**
  * mei_me_hw_ready_wait - wait until the me(hw) has turned ready
  *  or timeout is reached
@@ -1219,6 +1232,9 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
                goto end;
        }
 
+       if (mei_me_hw_is_resetting(dev))
+               mei_hcsr_set_hig(dev);
+
        mei_me_pg_intr(dev, me_intr_src(hcsr));
 
        /*  check if we need to start the dev */