From: Youngsoo Date: Thu, 18 Apr 2019 04:50:23 +0000 (+0900) Subject: [RAMEN9610-14499][common][9610] wlbt: fix completion and use completion_done API X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c8dfbe592de41f5d99438092ba1938b5113f1607;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [RAMEN9610-14499][common][9610] wlbt: fix completion and use completion_done API When we get rapid requests for SABLE generation, to serialise while processing current request, we ignore requests other than "fw_panic" in wlbtd and send a msg "ignoring" back to kernel. We must complete in this case as well. We must complete one completion upon message from wlbtdi, which has waiter(s). completion_done() API does the check without modifying the completion in anyway and returns false if there are waiters and true otherwise SCSC-Bug-Id: ssb-51156 previous patch : -Change-Id: Ieabcd8377a3040bdcfe51e4310eb55d84c693446 -Signed-off-by: Purnendu Kapadia Change-Id: Id6ff01e96b2e1e3de7f940c9e2ef1a75211ae5dd Signed-off-by: Youngsoo --- diff --git a/drivers/misc/samsung/scsc/scsc_wlbtd.c b/drivers/misc/samsung/scsc/scsc_wlbtd.c index 75e50e896ce6..1c7fdcfb67b8 100755 --- a/drivers/misc/samsung/scsc/scsc_wlbtd.c +++ b/drivers/misc/samsung/scsc/scsc_wlbtd.c @@ -40,8 +40,7 @@ static int msg_from_wlbtd_cb(struct sk_buff *skb, struct genl_info *info) SCSC_TAG_ERR(WLBTD, "ATTR_INT: %u\n", status); } - if (!completion_done(&event_done)) - complete(&event_done); + complete(&event_done); return 0; } @@ -86,14 +85,24 @@ static int msg_from_wlbtd_sable_cb(struct sk_buff *skb, struct genl_info *info) * ---> complete the completion with waiter(s) */ - if (!completion_done(&fw_panic_done)) { - SCSC_TAG_INFO(WLBTD, "completing fw_panic_done\n"); - complete(&fw_panic_done); - } - - if (!completion_done(&event_done)) { - SCSC_TAG_INFO(WLBTD, "completing event_done\n"); - complete(&event_done); + if ((strstr(data, "scsc_log_fw_panic") != NULL) || + (strstr(data, "not found.") != NULL) || + (strstr(data, "failed"))) { + if (!completion_done(&fw_panic_done)) { + SCSC_TAG_INFO(WLBTD, "completing fw_panic_done\n"); + complete(&fw_panic_done); + return 0; + } + } + + if ((strstr(data, ".sbl") != NULL) || + (strstr(data, "ignoring") != NULL) || + (strstr(data, "not found.") != NULL) || + (strstr(data, "failed"))) { + if (!completion_done(&event_done)) { + SCSC_TAG_INFO(WLBTD, "completing event_done\n"); + complete(&event_done); + } } return 0;