diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-21 00:20:31 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-21 00:20:31 -0400 |
| commit | 5af2344013454640e0133bb62e8cf2e30190a472 (patch) | |
| tree | 93495d1eb88d7498dac4747a3d28081c09a69a55 /drivers/misc/mei | |
| parent | 19e36ad292ab24980db64a5ff17973d3118a8fb9 (diff) | |
| parent | 725d0123dfff3d7b666cf57f5d29c50addfc99d3 (diff) | |
Merge tag 'char-misc-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char / misc driver updates from Greg KH:
"Here's the big char and misc driver update for 4.7-rc1.
Lots of different tiny driver subsystems have updates here with new
drivers and functionality. Details in the shortlog.
All have been in linux-next with no reported issues for a while"
* tag 'char-misc-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (125 commits)
mcb: Delete num_cells variable which is not required
mcb: Fixed bar number assignment for the gdd
mcb: Replace ioremap and request_region with the devm version
mcb: Implement bus->dev.release callback
mcb: export bus information via sysfs
mcb: Correctly initialize the bus's device
mei: bus: call mei_cl_read_start under device lock
coresight: etb10: adjust read pointer only when needed
coresight: configuring ETF in FIFO mode when acting as link
coresight: tmc: implementing TMC-ETF AUX space API
coresight: moving struct cs_buffers to header file
coresight: tmc: keep track of memory width
coresight: tmc: make sysFS and Perf mode mutually exclusive
coresight: tmc: dump system memory content only when needed
coresight: tmc: adding mode of operation for link/sinks
coresight: tmc: getting rid of multiple read access
coresight: tmc: allocating memory when needed
coresight: tmc: making prepare/unprepare functions generic
coresight: tmc: splitting driver in ETB/ETF and ETR components
coresight: tmc: cleaning up header file
...
Diffstat (limited to 'drivers/misc/mei')
| -rw-r--r-- | drivers/misc/mei/amthif.c | 4 | ||||
| -rw-r--r-- | drivers/misc/mei/bus.c | 42 | ||||
| -rw-r--r-- | drivers/misc/mei/client.c | 30 | ||||
| -rw-r--r-- | drivers/misc/mei/hbm.c | 26 | ||||
| -rw-r--r-- | drivers/misc/mei/interrupt.c | 6 | ||||
| -rw-r--r-- | drivers/misc/mei/mei_dev.h | 4 |
6 files changed, 57 insertions, 55 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c index 194360a5f782..a039a5df6f21 100644 --- a/drivers/misc/mei/amthif.c +++ b/drivers/misc/mei/amthif.c | |||
| @@ -380,8 +380,10 @@ int mei_amthif_irq_read_msg(struct mei_cl *cl, | |||
| 380 | 380 | ||
| 381 | dev = cl->dev; | 381 | dev = cl->dev; |
| 382 | 382 | ||
| 383 | if (dev->iamthif_state != MEI_IAMTHIF_READING) | 383 | if (dev->iamthif_state != MEI_IAMTHIF_READING) { |
| 384 | mei_irq_discard_msg(dev, mei_hdr); | ||
| 384 | return 0; | 385 | return 0; |
| 386 | } | ||
| 385 | 387 | ||
| 386 | ret = mei_cl_irq_read_msg(cl, mei_hdr, cmpl_list); | 388 | ret = mei_cl_irq_read_msg(cl, mei_hdr, cmpl_list); |
| 387 | if (ret) | 389 | if (ret) |
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 5d5996e39a67..1f33fea9299f 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c | |||
| @@ -220,17 +220,23 @@ EXPORT_SYMBOL_GPL(mei_cldev_recv); | |||
| 220 | static void mei_cl_bus_event_work(struct work_struct *work) | 220 | static void mei_cl_bus_event_work(struct work_struct *work) |
| 221 | { | 221 | { |
| 222 | struct mei_cl_device *cldev; | 222 | struct mei_cl_device *cldev; |
| 223 | struct mei_device *bus; | ||
| 223 | 224 | ||
| 224 | cldev = container_of(work, struct mei_cl_device, event_work); | 225 | cldev = container_of(work, struct mei_cl_device, event_work); |
| 225 | 226 | ||
| 227 | bus = cldev->bus; | ||
| 228 | |||
| 226 | if (cldev->event_cb) | 229 | if (cldev->event_cb) |
| 227 | cldev->event_cb(cldev, cldev->events, cldev->event_context); | 230 | cldev->event_cb(cldev, cldev->events, cldev->event_context); |
| 228 | 231 | ||
| 229 | cldev->events = 0; | 232 | cldev->events = 0; |
| 230 | 233 | ||
| 231 | /* Prepare for the next read */ | 234 | /* Prepare for the next read */ |
| 232 | if (cldev->events_mask & BIT(MEI_CL_EVENT_RX)) | 235 | if (cldev->events_mask & BIT(MEI_CL_EVENT_RX)) { |
| 236 | mutex_lock(&bus->device_lock); | ||
| 233 | mei_cl_read_start(cldev->cl, 0, NULL); | 237 | mei_cl_read_start(cldev->cl, 0, NULL); |
| 238 | mutex_unlock(&bus->device_lock); | ||
| 239 | } | ||
| 234 | } | 240 | } |
| 235 | 241 | ||
| 236 | /** | 242 | /** |
| @@ -304,6 +310,7 @@ int mei_cldev_register_event_cb(struct mei_cl_device *cldev, | |||
| 304 | unsigned long events_mask, | 310 | unsigned long events_mask, |
| 305 | mei_cldev_event_cb_t event_cb, void *context) | 311 | mei_cldev_event_cb_t event_cb, void *context) |
| 306 | { | 312 | { |
| 313 | struct mei_device *bus = cldev->bus; | ||
| 307 | int ret; | 314 | int ret; |
| 308 | 315 | ||
| 309 | if (cldev->event_cb) | 316 | if (cldev->event_cb) |
| @@ -316,15 +323,17 @@ int mei_cldev_register_event_cb(struct mei_cl_device *cldev, | |||
| 316 | INIT_WORK(&cldev->event_work, mei_cl_bus_event_work); | 323 | INIT_WORK(&cldev->event_work, mei_cl_bus_event_work); |
| 317 | 324 | ||
| 318 | if (cldev->events_mask & BIT(MEI_CL_EVENT_RX)) { | 325 | if (cldev->events_mask & BIT(MEI_CL_EVENT_RX)) { |
| 326 | mutex_lock(&bus->device_lock); | ||
| 319 | ret = mei_cl_read_start(cldev->cl, 0, NULL); | 327 | ret = mei_cl_read_start(cldev->cl, 0, NULL); |
| 328 | mutex_unlock(&bus->device_lock); | ||
| 320 | if (ret && ret != -EBUSY) | 329 | if (ret && ret != -EBUSY) |
| 321 | return ret; | 330 | return ret; |
| 322 | } | 331 | } |
| 323 | 332 | ||
| 324 | if (cldev->events_mask & BIT(MEI_CL_EVENT_NOTIF)) { | 333 | if (cldev->events_mask & BIT(MEI_CL_EVENT_NOTIF)) { |
| 325 | mutex_lock(&cldev->cl->dev->device_lock); | 334 | mutex_lock(&bus->device_lock); |
| 326 | ret = mei_cl_notify_request(cldev->cl, NULL, event_cb ? 1 : 0); | 335 | ret = mei_cl_notify_request(cldev->cl, NULL, event_cb ? 1 : 0); |
| 327 | mutex_unlock(&cldev->cl->dev->device_lock); | 336 | mutex_unlock(&bus->device_lock); |
| 328 | if (ret) | 337 | if (ret) |
| 329 | return ret; | 338 | return ret; |
| 330 | } | 339 | } |
| @@ -580,6 +589,7 @@ static int mei_cl_device_probe(struct device *dev) | |||
| 580 | struct mei_cl_device *cldev; | 589 | struct mei_cl_device *cldev; |
| 581 | struct mei_cl_driver *cldrv; | 590 | struct mei_cl_driver *cldrv; |
| 582 | const struct mei_cl_device_id *id; | 591 | const struct mei_cl_device_id *id; |
| 592 | int ret; | ||
| 583 | 593 | ||
| 584 | cldev = to_mei_cl_device(dev); | 594 | cldev = to_mei_cl_device(dev); |
| 585 | cldrv = to_mei_cl_driver(dev->driver); | 595 | cldrv = to_mei_cl_driver(dev->driver); |
| @@ -594,9 +604,12 @@ static int mei_cl_device_probe(struct device *dev) | |||
| 594 | if (!id) | 604 | if (!id) |
| 595 | return -ENODEV; | 605 | return -ENODEV; |
| 596 | 606 | ||
| 597 | __module_get(THIS_MODULE); | 607 | ret = cldrv->probe(cldev, id); |
| 608 | if (ret) | ||
| 609 | return ret; | ||
| 598 | 610 | ||
| 599 | return cldrv->probe(cldev, id); | 611 | __module_get(THIS_MODULE); |
| 612 | return 0; | ||
| 600 | } | 613 | } |
| 601 | 614 | ||
| 602 | /** | 615 | /** |
| @@ -634,11 +647,8 @@ static ssize_t name_show(struct device *dev, struct device_attribute *a, | |||
| 634 | char *buf) | 647 | char *buf) |
| 635 | { | 648 | { |
| 636 | struct mei_cl_device *cldev = to_mei_cl_device(dev); | 649 | struct mei_cl_device *cldev = to_mei_cl_device(dev); |
| 637 | size_t len; | ||
| 638 | |||
| 639 | len = snprintf(buf, PAGE_SIZE, "%s", cldev->name); | ||
| 640 | 650 | ||
| 641 | return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; | 651 | return scnprintf(buf, PAGE_SIZE, "%s", cldev->name); |
| 642 | } | 652 | } |
| 643 | static DEVICE_ATTR_RO(name); | 653 | static DEVICE_ATTR_RO(name); |
| 644 | 654 | ||
| @@ -647,11 +657,8 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *a, | |||
| 647 | { | 657 | { |
| 648 | struct mei_cl_device *cldev = to_mei_cl_device(dev); | 658 | struct mei_cl_device *cldev = to_mei_cl_device(dev); |
| 649 | const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl); | 659 | const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl); |
| 650 | size_t len; | ||
| 651 | 660 | ||
| 652 | len = snprintf(buf, PAGE_SIZE, "%pUl", uuid); | 661 | return scnprintf(buf, PAGE_SIZE, "%pUl", uuid); |
| 653 | |||
| 654 | return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; | ||
| 655 | } | 662 | } |
| 656 | static DEVICE_ATTR_RO(uuid); | 663 | static DEVICE_ATTR_RO(uuid); |
| 657 | 664 | ||
| @@ -660,11 +667,8 @@ static ssize_t version_show(struct device *dev, struct device_attribute *a, | |||
| 660 | { | 667 | { |
| 661 | struct mei_cl_device *cldev = to_mei_cl_device(dev); | 668 | struct mei_cl_device *cldev = to_mei_cl_device(dev); |
| 662 | u8 version = mei_me_cl_ver(cldev->me_cl); | 669 | u8 version = mei_me_cl_ver(cldev->me_cl); |
| 663 | size_t len; | ||
| 664 | |||
| 665 | len = snprintf(buf, PAGE_SIZE, "%02X", version); | ||
| 666 | 670 | ||
| 667 | return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; | 671 | return scnprintf(buf, PAGE_SIZE, "%02X", version); |
| 668 | } | 672 | } |
| 669 | static DEVICE_ATTR_RO(version); | 673 | static DEVICE_ATTR_RO(version); |
| 670 | 674 | ||
| @@ -673,10 +677,8 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a, | |||
| 673 | { | 677 | { |
| 674 | struct mei_cl_device *cldev = to_mei_cl_device(dev); | 678 | struct mei_cl_device *cldev = to_mei_cl_device(dev); |
| 675 | const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl); | 679 | const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl); |
| 676 | size_t len; | ||
| 677 | 680 | ||
| 678 | len = snprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", cldev->name, uuid); | 681 | return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", cldev->name, uuid); |
| 679 | return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; | ||
| 680 | } | 682 | } |
| 681 | static DEVICE_ATTR_RO(modalias); | 683 | static DEVICE_ATTR_RO(modalias); |
| 682 | 684 | ||
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index bab17e4197b6..eed254da63a8 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c | |||
| @@ -727,6 +727,11 @@ static void mei_cl_wake_all(struct mei_cl *cl) | |||
| 727 | cl_dbg(dev, cl, "Waking up waiting for event clients!\n"); | 727 | cl_dbg(dev, cl, "Waking up waiting for event clients!\n"); |
| 728 | wake_up_interruptible(&cl->ev_wait); | 728 | wake_up_interruptible(&cl->ev_wait); |
| 729 | } | 729 | } |
| 730 | /* synchronized under device mutex */ | ||
| 731 | if (waitqueue_active(&cl->wait)) { | ||
| 732 | cl_dbg(dev, cl, "Waking up ctrl write clients!\n"); | ||
| 733 | wake_up_interruptible(&cl->wait); | ||
| 734 | } | ||
| 730 | } | 735 | } |
| 731 | 736 | ||
| 732 | /** | 737 | /** |
| @@ -879,12 +884,15 @@ static int __mei_cl_disconnect(struct mei_cl *cl) | |||
| 879 | } | 884 | } |
| 880 | 885 | ||
| 881 | mutex_unlock(&dev->device_lock); | 886 | mutex_unlock(&dev->device_lock); |
| 882 | wait_event_timeout(cl->wait, cl->state == MEI_FILE_DISCONNECT_REPLY, | 887 | wait_event_timeout(cl->wait, |
| 888 | cl->state == MEI_FILE_DISCONNECT_REPLY || | ||
| 889 | cl->state == MEI_FILE_DISCONNECTED, | ||
| 883 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); | 890 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); |
| 884 | mutex_lock(&dev->device_lock); | 891 | mutex_lock(&dev->device_lock); |
| 885 | 892 | ||
| 886 | rets = cl->status; | 893 | rets = cl->status; |
| 887 | if (cl->state != MEI_FILE_DISCONNECT_REPLY) { | 894 | if (cl->state != MEI_FILE_DISCONNECT_REPLY && |
| 895 | cl->state != MEI_FILE_DISCONNECTED) { | ||
| 888 | cl_dbg(dev, cl, "timeout on disconnect from FW client.\n"); | 896 | cl_dbg(dev, cl, "timeout on disconnect from FW client.\n"); |
| 889 | rets = -ETIME; | 897 | rets = -ETIME; |
| 890 | } | 898 | } |
| @@ -1085,6 +1093,7 @@ int mei_cl_connect(struct mei_cl *cl, struct mei_me_client *me_cl, | |||
| 1085 | mutex_unlock(&dev->device_lock); | 1093 | mutex_unlock(&dev->device_lock); |
| 1086 | wait_event_timeout(cl->wait, | 1094 | wait_event_timeout(cl->wait, |
| 1087 | (cl->state == MEI_FILE_CONNECTED || | 1095 | (cl->state == MEI_FILE_CONNECTED || |
| 1096 | cl->state == MEI_FILE_DISCONNECTED || | ||
| 1088 | cl->state == MEI_FILE_DISCONNECT_REQUIRED || | 1097 | cl->state == MEI_FILE_DISCONNECT_REQUIRED || |
| 1089 | cl->state == MEI_FILE_DISCONNECT_REPLY), | 1098 | cl->state == MEI_FILE_DISCONNECT_REPLY), |
| 1090 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); | 1099 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); |
| @@ -1333,16 +1342,13 @@ int mei_cl_notify_request(struct mei_cl *cl, | |||
| 1333 | } | 1342 | } |
| 1334 | 1343 | ||
| 1335 | mutex_unlock(&dev->device_lock); | 1344 | mutex_unlock(&dev->device_lock); |
| 1336 | wait_event_timeout(cl->wait, cl->notify_en == request, | 1345 | wait_event_timeout(cl->wait, |
| 1337 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); | 1346 | cl->notify_en == request || !mei_cl_is_connected(cl), |
| 1347 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); | ||
| 1338 | mutex_lock(&dev->device_lock); | 1348 | mutex_lock(&dev->device_lock); |
| 1339 | 1349 | ||
| 1340 | if (cl->notify_en != request) { | 1350 | if (cl->notify_en != request && !cl->status) |
| 1341 | mei_io_list_flush(&dev->ctrl_rd_list, cl); | 1351 | cl->status = -EFAULT; |
| 1342 | mei_io_list_flush(&dev->ctrl_wr_list, cl); | ||
| 1343 | if (!cl->status) | ||
| 1344 | cl->status = -EFAULT; | ||
| 1345 | } | ||
| 1346 | 1352 | ||
| 1347 | rets = cl->status; | 1353 | rets = cl->status; |
| 1348 | 1354 | ||
| @@ -1767,6 +1773,10 @@ void mei_cl_complete(struct mei_cl *cl, struct mei_cl_cb *cb) | |||
| 1767 | wake_up(&cl->wait); | 1773 | wake_up(&cl->wait); |
| 1768 | 1774 | ||
| 1769 | break; | 1775 | break; |
| 1776 | case MEI_FOP_DISCONNECT_RSP: | ||
| 1777 | mei_io_cb_free(cb); | ||
| 1778 | mei_cl_set_disconnected(cl); | ||
| 1779 | break; | ||
| 1770 | default: | 1780 | default: |
| 1771 | BUG_ON(0); | 1781 | BUG_ON(0); |
| 1772 | } | 1782 | } |
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index 5e305d2605f3..5aa606c8a827 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c | |||
| @@ -113,8 +113,6 @@ void mei_hbm_idle(struct mei_device *dev) | |||
| 113 | */ | 113 | */ |
| 114 | void mei_hbm_reset(struct mei_device *dev) | 114 | void mei_hbm_reset(struct mei_device *dev) |
| 115 | { | 115 | { |
| 116 | dev->me_client_index = 0; | ||
| 117 | |||
| 118 | mei_me_cl_rm_all(dev); | 116 | mei_me_cl_rm_all(dev); |
| 119 | 117 | ||
| 120 | mei_hbm_idle(dev); | 118 | mei_hbm_idle(dev); |
| @@ -530,24 +528,22 @@ static void mei_hbm_cl_notify(struct mei_device *dev, | |||
| 530 | * mei_hbm_prop_req - request property for a single client | 528 | * mei_hbm_prop_req - request property for a single client |
| 531 | * | 529 | * |
| 532 | * @dev: the device structure | 530 | * @dev: the device structure |
| 531 | * @start_idx: client index to start search | ||
| 533 | * | 532 | * |
| 534 | * Return: 0 on success and < 0 on failure | 533 | * Return: 0 on success and < 0 on failure |
| 535 | */ | 534 | */ |
| 536 | 535 | static int mei_hbm_prop_req(struct mei_device *dev, unsigned long start_idx) | |
| 537 | static int mei_hbm_prop_req(struct mei_device *dev) | ||
| 538 | { | 536 | { |
| 539 | |||
| 540 | struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; | 537 | struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; |
| 541 | struct hbm_props_request *prop_req; | 538 | struct hbm_props_request *prop_req; |
| 542 | const size_t len = sizeof(struct hbm_props_request); | 539 | const size_t len = sizeof(struct hbm_props_request); |
| 543 | unsigned long next_client_index; | 540 | unsigned long addr; |
| 544 | int ret; | 541 | int ret; |
| 545 | 542 | ||
| 546 | next_client_index = find_next_bit(dev->me_clients_map, MEI_CLIENTS_MAX, | 543 | addr = find_next_bit(dev->me_clients_map, MEI_CLIENTS_MAX, start_idx); |
| 547 | dev->me_client_index); | ||
| 548 | 544 | ||
| 549 | /* We got all client properties */ | 545 | /* We got all client properties */ |
| 550 | if (next_client_index == MEI_CLIENTS_MAX) { | 546 | if (addr == MEI_CLIENTS_MAX) { |
| 551 | dev->hbm_state = MEI_HBM_STARTED; | 547 | dev->hbm_state = MEI_HBM_STARTED; |
| 552 | mei_host_client_init(dev); | 548 | mei_host_client_init(dev); |
| 553 | 549 | ||
| @@ -560,7 +556,7 @@ static int mei_hbm_prop_req(struct mei_device *dev) | |||
| 560 | memset(prop_req, 0, sizeof(struct hbm_props_request)); | 556 | memset(prop_req, 0, sizeof(struct hbm_props_request)); |
| 561 | 557 | ||
| 562 | prop_req->hbm_cmd = HOST_CLIENT_PROPERTIES_REQ_CMD; | 558 | prop_req->hbm_cmd = HOST_CLIENT_PROPERTIES_REQ_CMD; |
| 563 | prop_req->me_addr = next_client_index; | 559 | prop_req->me_addr = addr; |
| 564 | 560 | ||
| 565 | ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data); | 561 | ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data); |
| 566 | if (ret) { | 562 | if (ret) { |
| @@ -570,7 +566,6 @@ static int mei_hbm_prop_req(struct mei_device *dev) | |||
| 570 | } | 566 | } |
| 571 | 567 | ||
| 572 | dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT; | 568 | dev->init_clients_timer = MEI_CLIENTS_INIT_TIMEOUT; |
| 573 | dev->me_client_index = next_client_index; | ||
| 574 | 569 | ||
| 575 | return 0; | 570 | return 0; |
| 576 | } | 571 | } |
| @@ -882,8 +877,7 @@ static int mei_hbm_fw_disconnect_req(struct mei_device *dev, | |||
| 882 | cb = mei_io_cb_init(cl, MEI_FOP_DISCONNECT_RSP, NULL); | 877 | cb = mei_io_cb_init(cl, MEI_FOP_DISCONNECT_RSP, NULL); |
| 883 | if (!cb) | 878 | if (!cb) |
| 884 | return -ENOMEM; | 879 | return -ENOMEM; |
| 885 | cl_dbg(dev, cl, "add disconnect response as first\n"); | 880 | list_add_tail(&cb->list, &dev->ctrl_wr_list.list); |
| 886 | list_add(&cb->list, &dev->ctrl_wr_list.list); | ||
| 887 | } | 881 | } |
| 888 | return 0; | 882 | return 0; |
| 889 | } | 883 | } |
| @@ -1152,10 +1146,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr) | |||
| 1152 | 1146 | ||
| 1153 | mei_hbm_me_cl_add(dev, props_res); | 1147 | mei_hbm_me_cl_add(dev, props_res); |
| 1154 | 1148 | ||
| 1155 | dev->me_client_index++; | ||
| 1156 | |||
| 1157 | /* request property for the next client */ | 1149 | /* request property for the next client */ |
| 1158 | if (mei_hbm_prop_req(dev)) | 1150 | if (mei_hbm_prop_req(dev, props_res->me_addr + 1)) |
| 1159 | return -EIO; | 1151 | return -EIO; |
| 1160 | 1152 | ||
| 1161 | break; | 1153 | break; |
| @@ -1181,7 +1173,7 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr) | |||
| 1181 | dev->hbm_state = MEI_HBM_CLIENT_PROPERTIES; | 1173 | dev->hbm_state = MEI_HBM_CLIENT_PROPERTIES; |
| 1182 | 1174 | ||
| 1183 | /* first property request */ | 1175 | /* first property request */ |
| 1184 | if (mei_hbm_prop_req(dev)) | 1176 | if (mei_hbm_prop_req(dev, 0)) |
| 1185 | return -EIO; | 1177 | return -EIO; |
| 1186 | 1178 | ||
| 1187 | break; | 1179 | break; |
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 1e5cb1f704f8..3831a7ba2531 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
| @@ -76,7 +76,6 @@ static inline int mei_cl_hbm_equal(struct mei_cl *cl, | |||
| 76 | * @dev: mei device | 76 | * @dev: mei device |
| 77 | * @hdr: message header | 77 | * @hdr: message header |
| 78 | */ | 78 | */ |
| 79 | static inline | ||
| 80 | void mei_irq_discard_msg(struct mei_device *dev, struct mei_msg_hdr *hdr) | 79 | void mei_irq_discard_msg(struct mei_device *dev, struct mei_msg_hdr *hdr) |
| 81 | { | 80 | { |
| 82 | /* | 81 | /* |
| @@ -194,10 +193,7 @@ static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, | |||
| 194 | return -EMSGSIZE; | 193 | return -EMSGSIZE; |
| 195 | 194 | ||
| 196 | ret = mei_hbm_cl_disconnect_rsp(dev, cl); | 195 | ret = mei_hbm_cl_disconnect_rsp(dev, cl); |
| 197 | mei_cl_set_disconnected(cl); | 196 | list_move_tail(&cb->list, &cmpl_list->list); |
| 198 | mei_io_cb_free(cb); | ||
| 199 | mei_me_cl_put(cl->me_cl); | ||
| 200 | cl->me_cl = NULL; | ||
| 201 | 197 | ||
| 202 | return ret; | 198 | return ret; |
| 203 | } | 199 | } |
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index db78e6d99456..c9e01021eadf 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h | |||
| @@ -396,7 +396,6 @@ const char *mei_pg_state_str(enum mei_pg_state state); | |||
| 396 | * @me_clients : list of FW clients | 396 | * @me_clients : list of FW clients |
| 397 | * @me_clients_map : FW clients bit map | 397 | * @me_clients_map : FW clients bit map |
| 398 | * @host_clients_map : host clients id pool | 398 | * @host_clients_map : host clients id pool |
| 399 | * @me_client_index : last FW client index in enumeration | ||
| 400 | * | 399 | * |
| 401 | * @allow_fixed_address: allow user space to connect a fixed client | 400 | * @allow_fixed_address: allow user space to connect a fixed client |
| 402 | * @override_fixed_address: force allow fixed address behavior | 401 | * @override_fixed_address: force allow fixed address behavior |
| @@ -486,7 +485,6 @@ struct mei_device { | |||
| 486 | struct list_head me_clients; | 485 | struct list_head me_clients; |
| 487 | DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX); | 486 | DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX); |
| 488 | DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX); | 487 | DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX); |
| 489 | unsigned long me_client_index; | ||
| 490 | 488 | ||
| 491 | bool allow_fixed_address; | 489 | bool allow_fixed_address; |
| 492 | bool override_fixed_address; | 490 | bool override_fixed_address; |
| @@ -704,6 +702,8 @@ bool mei_hbuf_acquire(struct mei_device *dev); | |||
| 704 | 702 | ||
| 705 | bool mei_write_is_idle(struct mei_device *dev); | 703 | bool mei_write_is_idle(struct mei_device *dev); |
| 706 | 704 | ||
| 705 | void mei_irq_discard_msg(struct mei_device *dev, struct mei_msg_hdr *hdr); | ||
| 706 | |||
| 707 | #if IS_ENABLED(CONFIG_DEBUG_FS) | 707 | #if IS_ENABLED(CONFIG_DEBUG_FS) |
| 708 | int mei_dbgfs_register(struct mei_device *dev, const char *name); | 708 | int mei_dbgfs_register(struct mei_device *dev, const char *name); |
| 709 | void mei_dbgfs_deregister(struct mei_device *dev); | 709 | void mei_dbgfs_deregister(struct mei_device *dev); |
