aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/hbm.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-15 13:48:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-15 13:48:44 -0500
commit4ba63072b998cc31515cc6305c25f3b808b50c01 (patch)
tree779863511765c70bfd232f676b885f940ba88722 /drivers/misc/mei/hbm.c
parente29876723f7cb7728f0d6a674d23f92673e9f112 (diff)
parent5fb31cd839c21130c0b2524ceb9244e98dfe10e3 (diff)
Merge tag 'char-misc-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char / misc patches from Greg KH: "Here's the big char/misc driver update for 3.20-rc1. Lots of little things in here, all described in the changelog. Nothing major or unusual, except maybe the binder selinux stuff, which was all acked by the proper selinux people and they thought it best to come through this tree. All of this has been in linux-next with no reported issues for a while" * tag 'char-misc-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (90 commits) coresight: fix function etm_writel_cp14() parameter order coresight-etm: remove check for unknown Kconfig macro coresight: fixing CPU hwid lookup in device tree coresight: remove the unnecessary function coresight_is_bit_set() coresight: fix the debug AMBA bus name coresight: remove the extra spaces coresight: fix the link between orphan connection and newly added device coresight: remove the unnecessary replicator property coresight: fix the replicator subtype value pdfdocs: Fix 'make pdfdocs' failure for 'uio-howto.tmpl' mcb: Fix error path of mcb_pci_probe virtio/console: verify device has config space ti-st: clean up data types (fix harmless memory corruption) mei: me: release hw from reset only during the reset flow mei: mask interrupt set bit on clean reset bit extcon: max77693: Constify struct regmap_config extcon: adc-jack: Release IIO channel on driver remove extcon: Remove duplicated include from extcon-class.c Drivers: hv: vmbus: hv_process_timer_expiration() can be static Drivers: hv: vmbus: serialize Offer and Rescind offer ...
Diffstat (limited to 'drivers/misc/mei/hbm.c')
-rw-r--r--drivers/misc/mei/hbm.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index 239d7f5d6a92..c8412d41e4f1 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -105,21 +105,6 @@ void mei_hbm_idle(struct mei_device *dev)
105} 105}
106 106
107/** 107/**
108 * mei_me_cl_remove_all - remove all me clients
109 *
110 * @dev: the device structure
111 */
112static void mei_me_cl_remove_all(struct mei_device *dev)
113{
114 struct mei_me_client *me_cl, *next;
115
116 list_for_each_entry_safe(me_cl, next, &dev->me_clients, list) {
117 list_del(&me_cl->list);
118 kfree(me_cl);
119 }
120}
121
122/**
123 * mei_hbm_reset - reset hbm counters and book keeping data structurs 108 * mei_hbm_reset - reset hbm counters and book keeping data structurs
124 * 109 *
125 * @dev: the device structure 110 * @dev: the device structure
@@ -128,7 +113,7 @@ void mei_hbm_reset(struct mei_device *dev)
128{ 113{
129 dev->me_client_index = 0; 114 dev->me_client_index = 0;
130 115
131 mei_me_cl_remove_all(dev); 116 mei_me_cl_rm_all(dev);
132 117
133 mei_hbm_idle(dev); 118 mei_hbm_idle(dev);
134} 119}
@@ -339,11 +324,16 @@ static int mei_hbm_me_cl_add(struct mei_device *dev,
339 struct hbm_props_response *res) 324 struct hbm_props_response *res)
340{ 325{
341 struct mei_me_client *me_cl; 326 struct mei_me_client *me_cl;
327 const uuid_le *uuid = &res->client_properties.protocol_name;
328
329 mei_me_cl_rm_by_uuid(dev, uuid);
342 330
343 me_cl = kzalloc(sizeof(struct mei_me_client), GFP_KERNEL); 331 me_cl = kzalloc(sizeof(struct mei_me_client), GFP_KERNEL);
344 if (!me_cl) 332 if (!me_cl)
345 return -ENOMEM; 333 return -ENOMEM;
346 334
335 mei_me_cl_init(me_cl);
336
347 me_cl->props = res->client_properties; 337 me_cl->props = res->client_properties;
348 me_cl->client_id = res->me_addr; 338 me_cl->client_id = res->me_addr;
349 me_cl->mei_flow_ctrl_creds = 0; 339 me_cl->mei_flow_ctrl_creds = 0;
@@ -484,6 +474,7 @@ static int mei_hbm_add_single_flow_creds(struct mei_device *dev,
484 struct hbm_flow_control *flow) 474 struct hbm_flow_control *flow)
485{ 475{
486 struct mei_me_client *me_cl; 476 struct mei_me_client *me_cl;
477 int rets;
487 478
488 me_cl = mei_me_cl_by_id(dev, flow->me_addr); 479 me_cl = mei_me_cl_by_id(dev, flow->me_addr);
489 if (!me_cl) { 480 if (!me_cl) {
@@ -492,14 +483,19 @@ static int mei_hbm_add_single_flow_creds(struct mei_device *dev,
492 return -ENOENT; 483 return -ENOENT;
493 } 484 }
494 485
495 if (WARN_ON(me_cl->props.single_recv_buf == 0)) 486 if (WARN_ON(me_cl->props.single_recv_buf == 0)) {
496 return -EINVAL; 487 rets = -EINVAL;
488 goto out;
489 }
497 490
498 me_cl->mei_flow_ctrl_creds++; 491 me_cl->mei_flow_ctrl_creds++;
499 dev_dbg(dev->dev, "recv flow ctrl msg ME %d (single) creds = %d.\n", 492 dev_dbg(dev->dev, "recv flow ctrl msg ME %d (single) creds = %d.\n",
500 flow->me_addr, me_cl->mei_flow_ctrl_creds); 493 flow->me_addr, me_cl->mei_flow_ctrl_creds);
501 494
502 return 0; 495 rets = 0;
496out:
497 mei_me_cl_put(me_cl);
498 return rets;
503} 499}
504 500
505/** 501/**