From 552e3ceaee84c8745ada3284fe940fb6e9a4b6a8 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Tue, 15 Sep 2015 05:56:09 -0700 Subject: pd: restart toggling immediatly when dual role mode is re-enabled Kick the PD task when the dual role toggling is enabled to ensure we start toggling immediatly and detect a UFP (USB device). The issue was visible with the CONFIG_USB_PD_LOW_POWER change where the task was waking up only every minute when the toggling was disabled, the whole system would take up to a minute after resume to detect a peripheral connected while in S3. Signed-off-by: Vincent Palatin BRANCH=smaug BUG=chrome-os-partner:45347 TEST=On Smaug, put the system into S3, plug a USB device (e.g. a USB key), transition to S0 and verify that the kernel is receiving immediatly the "host mode" notification. Change-Id: I12d10941f9d2cefdfe711847ba0aec9f269e9bcd Reviewed-on: https://chromium-review.googlesource.com/299796 Reviewed-by: Alec Berg Commit-Queue: Vincent Palatin Tested-by: Vincent Palatin (cherry picked from commit 6a0e8ec3b9b1a7a0eb222a9e6c132d88d33f60e2) Reviewed-on: https://chromium-review.googlesource.com/299807 Commit-Ready: Vincent Palatin --- common/usb_pd_protocol.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 70aff84204..c058a59468 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -2560,6 +2560,8 @@ static void dual_role_on(void) #endif pd[i].flags |= PD_FLAGS_CHECK_PR_ROLE | PD_FLAGS_CHECK_DR_ROLE; + /* kick the task to ensure we start toggling immediatly */ + task_wake(PD_PORT_TO_TASK_ID(i)); } } DECLARE_HOOK(HOOK_CHIPSET_RESUME, dual_role_on, HOOK_PRIO_DEFAULT); -- cgit v1.2.1