From patchwork Thu Sep 27 20:08:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11803 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7041A24140 for ; Thu, 27 Sep 2012 20:09:59 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 2412CA18351 for ; Thu, 27 Sep 2012 20:09:59 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234801iej.11 for ; Thu, 27 Sep 2012 13:09:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=5k4Q8kxKYTLo56Ws66RqAOIBVZkC0MDPiFCQa05IOss=; b=RZVAUu4Ba0/vB/0cRNiGQLPuvnEzgR+oEIwkn/TEqnSs6bjc0IjLYqO8mTDn+GekxO 2xVTKnadmPsxz8o1HkFW60AihuOhv3o3ASO8qaCUSwHhH1s0vA1IP4ltKd/EoNbF5w2E UQJE2+iosHJpelfFQV5lK/tp3py5FfiSIWYzKHjgFtLPNwEWzE0MnUUbvoKdRGQJo8DE x/FAzgyLY1hjYFXpkbgLxtupH10pzOeLvNnFLSc16D8BCQAGMnmI6MmGYETMjNOlofQp QpwsOqvmvQENo2RAagkI/2r2lZ59gyErH/PWEssn1EmPJ+rlYbax74IgrSDxbXtWojPu Sb7w== Received: by 10.50.7.212 with SMTP id l20mr4641919iga.43.1348776598883; Thu, 27 Sep 2012 13:09:58 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp436330igc; Thu, 27 Sep 2012 13:09:58 -0700 (PDT) Received: by 10.68.217.104 with SMTP id ox8mr6185903pbc.35.1348776598346; Thu, 27 Sep 2012 13:09:58 -0700 (PDT) Received: from mail-da0-f50.google.com (mail-da0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id wn9si8349880pbc.234.2012.09.27.13.09.58 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) smtp.mail=mathieu.poirier@linaro.org Received: by daez20 with SMTP id z20so544914dae.37 for ; Thu, 27 Sep 2012 13:09:58 -0700 (PDT) Received: by 10.68.190.233 with SMTP id gt9mr14334064pbc.137.1348776597891; Thu, 27 Sep 2012 13:09:57 -0700 (PDT) Received: from localhost.localdomain (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPS id sa2sm1587890pbc.4.2012.09.27.13.09.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:56 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 30/57] power: ab8500: Flush & sync all works Date: Thu, 27 Sep 2012 14:08:47 -0600 Message-Id: <1348776554-10019-31-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> References: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> X-Gm-Message-State: ALoCoQmi4Jk2NBEQiPrvOH25+czQCacd4VFlTRYUMf4vBYX93q7OB1SP/waSczkKr0HHUYCXfYNN From: Jonas Aaberg Flush and sync all workqueues at suspend to avoid that we suspend in the middle of a work. Signed-off-by: Jonas Aaberg Signed-off-by: Mathieu Poirier Reviewed-by: Marcus COOPER --- drivers/power/ab8500_charger.c | 11 +++++++++++ drivers/power/ab8500_fg.c | 5 +++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index ee5ad7b..071c7c2 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@ -2862,6 +2862,17 @@ static int ab8500_charger_suspend(struct platform_device *pdev, if (delayed_work_pending(&di->check_hw_failure_work)) cancel_delayed_work(&di->check_hw_failure_work); + flush_delayed_work_sync(&di->attach_work); + flush_delayed_work_sync(&di->usb_charger_attached_work); + flush_delayed_work_sync(&di->ac_charger_attached_work); + flush_delayed_work_sync(&di->check_usbchgnotok_work); + flush_delayed_work_sync(&di->check_vbat_work); + flush_delayed_work_sync(&di->kick_wd_work); + + flush_work_sync(&di->usb_link_status_work); + flush_work_sync(&di->ac_work); + flush_work_sync(&di->detect_usb_type_work); + return 0; } #else diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index e7a0e1f..0e71e7e 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -2626,6 +2626,11 @@ static int ab8500_fg_suspend(struct platform_device *pdev, struct ab8500_fg *di = platform_get_drvdata(pdev); flush_delayed_work_sync(&di->fg_periodic_work); + flush_work_sync(&di->fg_work); + flush_work_sync(&di->fg_acc_cur_work); + flush_delayed_work_sync(&di->fg_reinit_work); + flush_delayed_work_sync(&di->fg_low_bat_work); + flush_delayed_work_sync(&di->fg_check_hw_failure_work); /* * If the FG is enabled we will disable it before going to suspend