Browse Source

mei: reset flow control on the last client disconnection

The FW resets the flow control for single buffer clients when the last
host client disconnects, also the driver has to follow this policy and
zero the flow control counter in such case.

Cc: <stable@vger.kernel.org> #4.1
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>
Alexander Usyskin 10 years ago
parent
commit
c241e9b1d9
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/misc/mei/client.c

+ 3 - 0
drivers/misc/mei/client.c

@@ -755,6 +755,9 @@ void mei_cl_set_disconnected(struct mei_cl *cl)
 	if (!WARN_ON(cl->me_cl->connect_count == 0))
 	if (!WARN_ON(cl->me_cl->connect_count == 0))
 		cl->me_cl->connect_count--;
 		cl->me_cl->connect_count--;
 
 
+	if (cl->me_cl->connect_count == 0)
+		cl->me_cl->mei_flow_ctrl_creds = 0;
+
 	mei_me_cl_put(cl->me_cl);
 	mei_me_cl_put(cl->me_cl);
 	cl->me_cl = NULL;
 	cl->me_cl = NULL;
 }
 }