mei: abort waiting for notification on unsupported HW
authorAlexander Usyskin <alexander.usyskin@intel.com>
Fri, 27 Jan 2017 14:32:42 +0000 (16:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Jan 2017 10:07:43 +0000 (11:07 +0100)
On legacy HW, pre Skylake, the notifications are not supported,
return -EOPNOTSUPP in mei_cl_notify_get and prevent
waiting indefinitely.

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/client.c

index ecfaef93457d9b3b2af871c21d93658437173b59..923fad39535c1e4ff242d27ad2483e032f281996 100644 (file)
@@ -1428,6 +1428,11 @@ int mei_cl_notify_get(struct mei_cl *cl, bool block, bool *notify_ev)
 
        dev = cl->dev;
 
+       if (!dev->hbm_f_ev_supported) {
+               cl_dbg(dev, cl, "notifications not supported\n");
+               return -EOPNOTSUPP;
+       }
+
        if (!mei_cl_is_connected(cl))
                return -ENODEV;