interrupt.c 13.7 KB
Newer Older
O
Oren Weil 已提交
1 2 3
/*
 *
 * Intel Management Engine Interface (Intel MEI) Linux driver
4
 * Copyright (c) 2003-2012, Intel Corporation.
O
Oren Weil 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 */


18
#include <linux/export.h>
O
Oren Weil 已提交
19 20 21 22
#include <linux/kthread.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/jiffies.h>
23
#include <linux/slab.h>
O
Oren Weil 已提交
24

25
#include <linux/mei.h>
26 27

#include "mei_dev.h"
28
#include "hbm.h"
T
Tomas Winkler 已提交
29
#include "client.h"
O
Oren Weil 已提交
30 31


32
/**
33
 * mei_irq_compl_handler - dispatch complete handlers
34 35
 *	for the completed callbacks
 *
36 37
 * @dev: mei device
 * @compl_list: list of completed cbs
38 39 40 41 42 43 44 45
 */
void mei_irq_compl_handler(struct mei_device *dev, struct mei_cl_cb *compl_list)
{
	struct mei_cl_cb *cb, *next;
	struct mei_cl *cl;

	list_for_each_entry_safe(cb, next, &compl_list->list, list) {
		cl = cb->cl;
46
		list_del_init(&cb->list);
47

48
		dev_dbg(dev->dev, "completing call back.\n");
49 50 51
		if (cl == &dev->iamthif_cl)
			mei_amthif_complete(dev, cb);
		else
52
			mei_cl_complete(cl, cb);
53 54
	}
}
55
EXPORT_SYMBOL_GPL(mei_irq_compl_handler);
56

O
Oren Weil 已提交
57
/**
58
 * mei_cl_hbm_equal - check if hbm is addressed to the client
O
Oren Weil 已提交
59
 *
60
 * @cl: host client
O
Oren Weil 已提交
61 62
 * @mei_hdr: header of mei client message
 *
63
 * Return: true if matches, false otherwise
O
Oren Weil 已提交
64
 */
65 66
static inline int mei_cl_hbm_equal(struct mei_cl *cl,
			struct mei_msg_hdr *mei_hdr)
O
Oren Weil 已提交
67
{
68 69 70
	return cl->host_client_id == mei_hdr->host_addr &&
		cl->me_client_id == mei_hdr->me_addr;
}
O
Oren Weil 已提交
71

72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
/**
 * mei_irq_discard_msg  - discard received message
 *
 * @dev: mei device
 * @hdr: message header
 */
static inline
void mei_irq_discard_msg(struct mei_device *dev, struct mei_msg_hdr *hdr)
{
	/*
	 * no need to check for size as it is guarantied
	 * that length fits into rd_msg_buf
	 */
	mei_read_slots(dev, dev->rd_msg_buf, hdr->length);
	dev_dbg(dev->dev, "discarding message " MEI_HDR_FMT "\n",
		MEI_HDR_PRM(hdr));
}

O
Oren Weil 已提交
90
/**
A
Alexander Usyskin 已提交
91
 * mei_cl_irq_read_msg - process client message
O
Oren Weil 已提交
92
 *
93
 * @cl: reading client
O
Oren Weil 已提交
94
 * @mei_hdr: header of mei client message
95
 * @complete_list: completion list
O
Oren Weil 已提交
96
 *
97
 * Return: always 0
O
Oren Weil 已提交
98
 */
99 100 101
int mei_cl_irq_read_msg(struct mei_cl *cl,
		       struct mei_msg_hdr *mei_hdr,
		       struct mei_cl_cb *complete_list)
O
Oren Weil 已提交
102
{
103 104
	struct mei_device *dev = cl->dev;
	struct mei_cl_cb *cb;
105
	unsigned char *buffer = NULL;
O
Oren Weil 已提交
106

T
Tomas Winkler 已提交
107 108 109
	cb = list_first_entry_or_null(&cl->rd_pending, struct mei_cl_cb, list);
	if (!cb) {
		cl_err(dev, cl, "pending read cb not found\n");
110 111
		goto out;
	}
112

T
Tomas Winkler 已提交
113 114 115
	if (cl->state != MEI_FILE_CONNECTED) {
		cl_dbg(dev, cl, "not connected\n");
		cb->status = -ENODEV;
116 117
		goto out;
	}
118

119
	if (cb->buf.size == 0 || cb->buf.data == NULL) {
120 121 122 123 124
		cl_err(dev, cl, "response buffer is not allocated.\n");
		list_move_tail(&cb->list, &complete_list->list);
		cb->status = -ENOMEM;
		goto out;
	}
125

126
	if (cb->buf.size < mei_hdr->length + cb->buf_idx) {
127
		cl_dbg(dev, cl, "message overflow. size %d len %d idx %ld\n",
128 129
			cb->buf.size, mei_hdr->length, cb->buf_idx);
		buffer = krealloc(cb->buf.data, mei_hdr->length + cb->buf_idx,
130 131 132 133 134 135
				  GFP_KERNEL);

		if (!buffer) {
			cb->status = -ENOMEM;
			list_move_tail(&cb->list, &complete_list->list);
			goto out;
136
		}
137 138
		cb->buf.data = buffer;
		cb->buf.size = mei_hdr->length + cb->buf_idx;
O
Oren Weil 已提交
139 140
	}

141
	buffer = cb->buf.data + cb->buf_idx;
142 143 144
	mei_read_slots(dev, buffer, mei_hdr->length);

	cb->buf_idx += mei_hdr->length;
145

146
	if (mei_hdr->msg_complete) {
147
		cb->read_time = jiffies;
T
Tomas Winkler 已提交
148
		cl_dbg(dev, cl, "completed read length = %lu\n", cb->buf_idx);
149 150 151 152
		list_move_tail(&cb->list, &complete_list->list);
	}

out:
153 154
	if (!buffer)
		mei_irq_discard_msg(dev, mei_hdr);
O
Oren Weil 已提交
155 156 157 158

	return 0;
}

T
Tomas Winkler 已提交
159 160 161 162 163 164 165
/**
 * mei_cl_irq_disconnect_rsp - send disconnection response message
 *
 * @cl: client
 * @cb: callback block.
 * @cmpl_list: complete list.
 *
166
 * Return: 0, OK; otherwise, error.
T
Tomas Winkler 已提交
167 168
 */
static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb,
169
				     struct mei_cl_cb *cmpl_list)
T
Tomas Winkler 已提交
170 171
{
	struct mei_device *dev = cl->dev;
172 173
	u32 msg_slots;
	int slots;
T
Tomas Winkler 已提交
174 175
	int ret;

176 177
	slots = mei_hbuf_empty_slots(dev);
	msg_slots = mei_data2slots(sizeof(struct hbm_client_connect_response));
T
Tomas Winkler 已提交
178

179
	if (slots < msg_slots)
T
Tomas Winkler 已提交
180 181 182 183 184 185 186 187 188 189 190 191 192
		return -EMSGSIZE;

	ret = mei_hbm_cl_disconnect_rsp(dev, cl);

	cl->state = MEI_FILE_DISCONNECTED;
	cl->status = 0;
	mei_io_cb_free(cb);

	return ret;
}



O
Oren Weil 已提交
193
/**
194
 * mei_cl_irq_disconnect - processes close related operation from
195
 *	interrupt thread context - send disconnect request
O
Oren Weil 已提交
196
 *
197 198
 * @cl: client
 * @cb: callback block.
O
Oren Weil 已提交
199 200
 * @cmpl_list: complete list.
 *
201
 * Return: 0, OK; otherwise, error.
O
Oren Weil 已提交
202
 */
203
static int mei_cl_irq_disconnect(struct mei_cl *cl, struct mei_cl_cb *cb,
204
			    struct mei_cl_cb *cmpl_list)
O
Oren Weil 已提交
205
{
206
	struct mei_device *dev = cl->dev;
207 208
	u32 msg_slots;
	int slots;
209

210 211
	msg_slots = mei_data2slots(sizeof(struct hbm_client_connect_request));
	slots = mei_hbuf_empty_slots(dev);
O
Oren Weil 已提交
212

213
	if (slots < msg_slots)
T
Tomas Winkler 已提交
214 215
		return -EMSGSIZE;

216
	if (mei_hbm_cl_disconnect_req(dev, cl)) {
217
		cl->status = 0;
218 219
		cb->buf_idx = 0;
		list_move_tail(&cb->list, &cmpl_list->list);
T
Tomas Winkler 已提交
220
		return -EIO;
O
Oren Weil 已提交
221 222
	}

T
Tomas Winkler 已提交
223 224
	cl->state = MEI_FILE_DISCONNECTING;
	cl->status = 0;
225 226
	cb->buf_idx = 0;
	list_move_tail(&cb->list, &dev->ctrl_rd_list.list);
T
Tomas Winkler 已提交
227 228
	cl->timer_count = MEI_CONNECT_TIMEOUT;

O
Oren Weil 已提交
229 230 231 232 233
	return 0;
}


/**
A
Alexander Usyskin 已提交
234
 * mei_cl_irq_read - processes client read related operation from the
235
 *	interrupt thread context - request for flow control credits
O
Oren Weil 已提交
236
 *
237 238
 * @cl: client
 * @cb: callback block.
O
Oren Weil 已提交
239 240
 * @cmpl_list: complete list.
 *
241
 * Return: 0, OK; otherwise, error.
O
Oren Weil 已提交
242
 */
243
static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb,
244
			   struct mei_cl_cb *cmpl_list)
O
Oren Weil 已提交
245
{
246
	struct mei_device *dev = cl->dev;
247 248
	u32 msg_slots;
	int slots;
249 250
	int ret;

251 252
	msg_slots = mei_data2slots(sizeof(struct hbm_flow_control));
	slots = mei_hbuf_empty_slots(dev);
253

254
	if (slots < msg_slots)
T
Tomas Winkler 已提交
255
		return -EMSGSIZE;
256

257 258 259
	ret = mei_hbm_cl_flow_control_req(dev, cl);
	if (ret) {
		cl->status = ret;
260 261
		cb->buf_idx = 0;
		list_move_tail(&cb->list, &cmpl_list->list);
262
		return ret;
263
	}
264

T
Tomas Winkler 已提交
265
	list_move_tail(&cb->list, &cl->rd_pending);
266

O
Oren Weil 已提交
267 268 269 270 271
	return 0;
}


/**
272
 * mei_cl_irq_connect - send connect request in irq_thread context
O
Oren Weil 已提交
273
 *
274 275
 * @cl: client
 * @cb: callback block.
O
Oren Weil 已提交
276 277
 * @cmpl_list: complete list.
 *
278
 * Return: 0, OK; otherwise, error.
O
Oren Weil 已提交
279
 */
280
static int mei_cl_irq_connect(struct mei_cl *cl, struct mei_cl_cb *cb,
281
			      struct mei_cl_cb *cmpl_list)
O
Oren Weil 已提交
282
{
283
	struct mei_device *dev = cl->dev;
284 285
	u32 msg_slots;
	int slots;
286
	int ret;
287

288 289
	msg_slots = mei_data2slots(sizeof(struct hbm_client_connect_request));
	slots = mei_hbuf_empty_slots(dev);
T
Tomas Winkler 已提交
290

291 292 293
	if (mei_cl_is_other_connecting(cl))
		return 0;

294
	if (slots < msg_slots)
T
Tomas Winkler 已提交
295 296
		return -EMSGSIZE;

297
	cl->state = MEI_FILE_CONNECTING;
T
Tomas Winkler 已提交
298

299 300 301
	ret = mei_hbm_cl_connect_req(dev, cl);
	if (ret) {
		cl->status = ret;
302
		cb->buf_idx = 0;
303
		list_del_init(&cb->list);
304
		return ret;
305
	}
306 307 308

	list_move_tail(&cb->list, &dev->ctrl_rd_list.list);
	cl->timer_count = MEI_CONNECT_TIMEOUT;
O
Oren Weil 已提交
309 310 311 312 313
	return 0;
}


/**
314
 * mei_irq_read_handler - bottom half read routine after ISR to
O
Oren Weil 已提交
315 316 317
 * handle the read processing.
 *
 * @dev: the device structure
318
 * @cmpl_list: An instance of our list structure
O
Oren Weil 已提交
319 320
 * @slots: slots to read.
 *
321
 * Return: 0 on success, <0 on failure.
O
Oren Weil 已提交
322
 */
323 324
int mei_irq_read_handler(struct mei_device *dev,
		struct mei_cl_cb *cmpl_list, s32 *slots)
O
Oren Weil 已提交
325 326
{
	struct mei_msg_hdr *mei_hdr;
T
Tomas Winkler 已提交
327 328
	struct mei_cl *cl;
	int ret;
O
Oren Weil 已提交
329 330

	if (!dev->rd_msg_hdr) {
331
		dev->rd_msg_hdr = mei_read_hdr(dev);
O
Oren Weil 已提交
332
		(*slots)--;
333
		dev_dbg(dev->dev, "slots =%08x.\n", *slots);
O
Oren Weil 已提交
334 335
	}
	mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr;
336
	dev_dbg(dev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
O
Oren Weil 已提交
337 338

	if (mei_hdr->reserved || !dev->rd_msg_hdr) {
339
		dev_err(dev->dev, "corrupted message header 0x%08X\n",
T
Tomas Winkler 已提交
340
				dev->rd_msg_hdr);
O
Oren Weil 已提交
341 342 343 344
		ret = -EBADMSG;
		goto end;
	}

T
Tomas Winkler 已提交
345
	if (mei_slots2data(*slots) < mei_hdr->length) {
346
		dev_err(dev->dev, "less data available than length=%08x.\n",
O
Oren Weil 已提交
347 348
				*slots);
		/* we can't read the message */
349
		ret = -ENODATA;
O
Oren Weil 已提交
350 351 352
		goto end;
	}

T
Tomas Winkler 已提交
353 354
	/*  HBM message */
	if (mei_hdr->host_addr == 0 && mei_hdr->me_addr == 0) {
355 356
		ret = mei_hbm_dispatch(dev, mei_hdr);
		if (ret) {
357
			dev_dbg(dev->dev, "mei_hbm_dispatch failed ret = %d\n",
358 359 360
					ret);
			goto end;
		}
T
Tomas Winkler 已提交
361 362
		goto reset_slots;
	}
363

364
	/* find recipient cl */
T
Tomas Winkler 已提交
365 366 367 368 369 370 371
	list_for_each_entry(cl, &dev->file_list, link) {
		if (mei_cl_hbm_equal(cl, mei_hdr)) {
			cl_dbg(dev, cl, "got a message\n");
			break;
		}
	}

372
	/* if no recipient cl was found we assume corrupted header */
T
Tomas Winkler 已提交
373
	if (&cl->link == &dev->file_list) {
374
		dev_err(dev->dev, "no destination client found 0x%08X\n",
T
Tomas Winkler 已提交
375 376 377 378 379
				dev->rd_msg_hdr);
		ret = -EBADMSG;
		goto end;
	}

380 381
	if (cl == &dev->iamthif_cl) {
		ret = mei_amthif_irq_read_msg(cl, mei_hdr, cmpl_list);
O
Oren Weil 已提交
382
	} else {
383
		ret = mei_cl_irq_read_msg(cl, mei_hdr, cmpl_list);
O
Oren Weil 已提交
384 385
	}

386

T
Tomas Winkler 已提交
387
reset_slots:
O
Oren Weil 已提交
388 389 390 391 392 393
	/* reset the number of slots and header */
	*slots = mei_count_full_read_slots(dev);
	dev->rd_msg_hdr = 0;

	if (*slots == -EOVERFLOW) {
		/* overflow - reset */
394
		dev_err(dev->dev, "resetting due to slots overflow.\n");
O
Oren Weil 已提交
395 396 397 398 399 400 401
		/* set the event since message has been read */
		ret = -ERANGE;
		goto end;
	}
end:
	return ret;
}
402
EXPORT_SYMBOL_GPL(mei_irq_read_handler);
O
Oren Weil 已提交
403 404 405


/**
406 407
 * mei_irq_write_handler -  dispatch write requests
 *  after irq received
O
Oren Weil 已提交
408 409
 *
 * @dev: the device structure
410
 * @cmpl_list: An instance of our list structure
O
Oren Weil 已提交
411
 *
412
 * Return: 0 on success, <0 on failure.
O
Oren Weil 已提交
413
 */
T
Tomas Winkler 已提交
414
int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
O
Oren Weil 已提交
415 416 417
{

	struct mei_cl *cl;
418
	struct mei_cl_cb *cb, *next;
419
	struct mei_cl_cb *list;
420
	s32 slots;
O
Oren Weil 已提交
421 422
	int ret;

423 424

	if (!mei_hbuf_acquire(dev))
O
Oren Weil 已提交
425
		return 0;
426

427 428
	slots = mei_hbuf_empty_slots(dev);
	if (slots <= 0)
429 430
		return -EMSGSIZE;

O
Oren Weil 已提交
431
	/* complete all waiting for write CB */
432
	dev_dbg(dev->dev, "complete all waiting for write cb.\n");
O
Oren Weil 已提交
433 434

	list = &dev->write_waiting_list;
435 436
	list_for_each_entry_safe(cb, next, &list->list, list) {
		cl = cb->cl;
437 438

		cl->status = 0;
439 440 441
		cl_dbg(dev, cl, "MEI WRITE COMPLETE\n");
		cl->writing_state = MEI_WRITE_COMPLETE;
		list_move_tail(&cb->list, &cmpl_list->list);
O
Oren Weil 已提交
442 443
	}

444 445
	if (dev->wd_state == MEI_WD_STOPPING) {
		dev->wd_state = MEI_WD_IDLE;
446
		wake_up(&dev->wait_stop_wd);
O
Oren Weil 已提交
447 448
	}

449
	if (mei_cl_is_connected(&dev->wd_cl)) {
O
Oren Weil 已提交
450
		if (dev->wd_pending &&
T
Tomas Winkler 已提交
451
		    mei_cl_flow_ctrl_creds(&dev->wd_cl) > 0) {
452 453 454
			ret = mei_wd_send(dev);
			if (ret)
				return ret;
455
			dev->wd_pending = false;
O
Oren Weil 已提交
456 457 458 459
		}
	}

	/* complete control write list CB */
460
	dev_dbg(dev->dev, "complete control write list cb.\n");
461 462 463
	list_for_each_entry_safe(cb, next, &dev->ctrl_wr_list.list, list) {
		cl = cb->cl;
		switch (cb->fop_type) {
464
		case MEI_FOP_DISCONNECT:
465
			/* send disconnect message */
466
			ret = mei_cl_irq_disconnect(cl, cb, cmpl_list);
467 468
			if (ret)
				return ret;
O
Oren Weil 已提交
469

470
			break;
471
		case MEI_FOP_READ:
472
			/* send flow control message */
473
			ret = mei_cl_irq_read(cl, cb, cmpl_list);
474 475
			if (ret)
				return ret;
O
Oren Weil 已提交
476

477
			break;
478
		case MEI_FOP_CONNECT:
479
			/* connect message */
480
			ret = mei_cl_irq_connect(cl, cb, cmpl_list);
481 482
			if (ret)
				return ret;
O
Oren Weil 已提交
483

484
			break;
T
Tomas Winkler 已提交
485 486
		case MEI_FOP_DISCONNECT_RSP:
			/* send disconnect resp */
487
			ret = mei_cl_irq_disconnect_rsp(cl, cb, cmpl_list);
T
Tomas Winkler 已提交
488 489
			if (ret)
				return ret;
490
			break;
491 492
		default:
			BUG();
O
Oren Weil 已提交
493
		}
494

O
Oren Weil 已提交
495 496
	}
	/* complete  write list CB */
497
	dev_dbg(dev->dev, "complete write list cb.\n");
498 499
	list_for_each_entry_safe(cb, next, &dev->write_list.list, list) {
		cl = cb->cl;
500
		if (cl == &dev->iamthif_cl)
501
			ret = mei_amthif_irq_write(cl, cb, cmpl_list);
502
		else
503
			ret = mei_cl_irq_write(cl, cb, cmpl_list);
504 505
		if (ret)
			return ret;
O
Oren Weil 已提交
506 507 508
	}
	return 0;
}
509
EXPORT_SYMBOL_GPL(mei_irq_write_handler);
O
Oren Weil 已提交
510 511 512 513 514 515 516 517 518



/**
 * mei_timer - timer function.
 *
 * @work: pointer to the work_struct structure
 *
 */
519
void mei_timer(struct work_struct *work)
O
Oren Weil 已提交
520 521
{
	unsigned long timeout;
522
	struct mei_cl *cl;
O
Oren Weil 已提交
523 524

	struct mei_device *dev = container_of(work,
525
					struct mei_device, timer_work.work);
O
Oren Weil 已提交
526 527 528


	mutex_lock(&dev->device_lock);
529 530 531 532 533 534 535

	/* Catch interrupt stalls during HBM init handshake */
	if (dev->dev_state == MEI_DEV_INIT_CLIENTS &&
	    dev->hbm_state != MEI_HBM_IDLE) {

		if (dev->init_clients_timer) {
			if (--dev->init_clients_timer == 0) {
536
				dev_err(dev->dev, "timer: init clients timeout hbm_state = %d.\n",
537
					dev->hbm_state);
538
				mei_reset(dev);
539
				goto out;
O
Oren Weil 已提交
540 541 542
			}
		}
	}
543 544 545 546

	if (dev->dev_state != MEI_DEV_ENABLED)
		goto out;

O
Oren Weil 已提交
547
	/*** connect/disconnect timeouts ***/
548 549 550
	list_for_each_entry(cl, &dev->file_list, link) {
		if (cl->timer_count) {
			if (--cl->timer_count == 0) {
551
				dev_err(dev->dev, "timer: connect/disconnect timeout.\n");
552
				mei_reset(dev);
O
Oren Weil 已提交
553 554 555 556 557
				goto out;
			}
		}
	}

558 559 560
	if (!mei_cl_is_connected(&dev->iamthif_cl))
		goto out;

O
Oren Weil 已提交
561 562
	if (dev->iamthif_stall_timer) {
		if (--dev->iamthif_stall_timer == 0) {
563
			dev_err(dev->dev, "timer: amthif  hanged.\n");
564
			mei_reset(dev);
565
			dev->iamthif_canceled = false;
O
Oren Weil 已提交
566 567 568
			dev->iamthif_state = MEI_IAMTHIF_IDLE;
			dev->iamthif_timer = 0;

569 570
			mei_io_cb_free(dev->iamthif_current_cb);
			dev->iamthif_current_cb = NULL;
O
Oren Weil 已提交
571 572

			dev->iamthif_file_object = NULL;
573
			mei_amthif_run_next_cmd(dev);
O
Oren Weil 已提交
574 575 576 577 578 579
		}
	}

	if (dev->iamthif_timer) {

		timeout = dev->iamthif_timer +
580
			mei_secs_to_jiffies(MEI_IAMTHIF_READ_TIMER);
O
Oren Weil 已提交
581

582
		dev_dbg(dev->dev, "dev->iamthif_timer = %ld\n",
O
Oren Weil 已提交
583
				dev->iamthif_timer);
584 585
		dev_dbg(dev->dev, "timeout = %ld\n", timeout);
		dev_dbg(dev->dev, "jiffies = %ld\n", jiffies);
O
Oren Weil 已提交
586 587 588 589 590 591
		if (time_after(jiffies, timeout)) {
			/*
			 * User didn't read the AMTHI data on time (15sec)
			 * freeing AMTHI for other requests
			 */

592
			dev_dbg(dev->dev, "freeing AMTHI for other requests\n");
O
Oren Weil 已提交
593

594 595
			mei_io_list_flush(&dev->amthif_rd_complete_list,
				&dev->iamthif_cl);
596 597
			mei_io_cb_free(dev->iamthif_current_cb);
			dev->iamthif_current_cb = NULL;
O
Oren Weil 已提交
598 599 600 601

			dev->iamthif_file_object->private_data = NULL;
			dev->iamthif_file_object = NULL;
			dev->iamthif_timer = 0;
602
			mei_amthif_run_next_cmd(dev);
O
Oren Weil 已提交
603 604 605 606

		}
	}
out:
607 608
	if (dev->dev_state != MEI_DEV_DISABLED)
		schedule_delayed_work(&dev->timer_work, 2 * HZ);
609
	mutex_unlock(&dev->device_lock);
O
Oren Weil 已提交
610
}