diff options
author | Sivaram Nair <sivaramn@nvidia.com> | 2013-06-12 12:06:06 +0300 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:32:26 -0700 |
commit | 3ba5effa242f5f58ba30dff2e3307c38de7c4985 (patch) | |
tree | bcdf74a501c16480e6e53caf54486d50b6ce7fcd /drivers/edp | |
parent | 9c8259f0b51f7ff65270e058f8e2d62ee06605e6 (diff) |
EDP: fix loan update gaps
The loan update notifier is not called in few situations - fix those.
Bug 1257143
Change-Id: I81a6ad18c2ffab9d1c7b2ea1d38f23e5a29156c8
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/238030
(cherry picked from commit 4fbde3eaaa42b758c9b274bf8970176e0a695e1a)
Reviewed-on: http://git-master/r/250620
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/edp')
-rw-r--r-- | drivers/edp/edp.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/edp/edp.c b/drivers/edp/edp.c index 9234b716cf4d..f86695b4f2ef 100644 --- a/drivers/edp/edp.c +++ b/drivers/edp/edp.c @@ -46,7 +46,7 @@ static void update_loans(struct edp_client *client) struct edp_governor *gov; gov = client->manager ? client->manager->gov : NULL; if (gov && client->cur && !list_empty(&client->borrowers)) { - if (gov->update_loans && *client->cur > client->ithreshold) + if (gov->update_loans) gov->update_loans(client); } } @@ -54,6 +54,7 @@ static void update_loans(struct edp_client *client) static void promote(struct work_struct *work) { unsigned int prev_denied; + struct edp_client *c; struct edp_manager *m = container_of(work, struct edp_manager, work); mutex_lock(&edp_lock); @@ -63,6 +64,8 @@ static void promote(struct work_struct *work) m->gov->promote(m); if (prev_denied != m->num_denied) sysfs_notify(m->kobj, NULL, "denied"); + list_for_each_entry(c, &m->clients, link) + update_loans(c); } mutex_unlock(&edp_lock); @@ -312,9 +315,13 @@ void edp_default_update_request(struct edp_client *client, /* generic default implementation */ void edp_default_update_loans(struct edp_client *lender) { - unsigned int size = *lender->cur - lender->ithreshold; + unsigned int size; + unsigned int cur; struct loan_client *p; + cur = cur_level(lender); + size = cur > lender->ithreshold ? cur - lender->ithreshold : 0; + list_for_each_entry(p, &lender->borrowers, link) { if (size != p->size) { p->size = p->client->notify_loan_update( @@ -323,8 +330,6 @@ void edp_default_update_loans(struct edp_client *lender) } size -= min(p->size, size); - if (!size) - return; } } |