From patchwork Mon Apr 29 21:45:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2502591 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8BA54DF25A for ; Mon, 29 Apr 2013 21:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759435Ab3D2Vpy (ORCPT ); Mon, 29 Apr 2013 17:45:54 -0400 Received: from mail-qe0-f74.google.com ([209.85.128.74]:49961 "EHLO mail-qe0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758199Ab3D2Vpw (ORCPT ); Mon, 29 Apr 2013 17:45:52 -0400 Received: by mail-qe0-f74.google.com with SMTP id a11so145756qen.1 for ; Mon, 29 Apr 2013 14:45:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=d81tDShh2e5kpvubxi1a8FWccqHZw5fNBGxPj8Q0uhs=; b=b/c2vSo5yCVsA1bBd4Hf9oSMs5Ruhqj9eYCA/l1d0XW17J9B9Hxo1lkuElwUo2MIYg 2PFvlD6ileKY4Tzdns6muVHLypV5J07NCZogwX9YoFyJ7Ea7ZiR0ATE56F/0XBwbWVvW RumnESif4xi6187gauQASRUaKvc29+o7cnE/dEx9MMaD9GxjASgfqOJvKUIcTD9VTB8+ clwd3SLN7/qymx44Iggm7xfj7F8MS0ipMSUk5kxjyUpHZS8Oy9LblMTHk/mIFpCai+mH a5b/b5pyRbil1sVJMXOLqS0+5miWLUniomPjUxLeZ2EhP3wjoMhPp/4FzXxLGPkhOnv8 V2Tw== X-Received: by 10.236.183.98 with SMTP id p62mr1391925yhm.3.1367271951907; Mon, 29 Apr 2013 14:45:51 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id s48si334024yhe.6.2013.04.29.14.45.51 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 29 Apr 2013 14:45:51 -0700 (PDT) Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.105.48]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id B064F31C022; Mon, 29 Apr 2013 14:45:51 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 7065C161EB9; Mon, 29 Apr 2013 14:45:51 -0700 (PDT) From: Colin Cross To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , arve@android.com, Colin Cross , Greg Kroah-Hartman , Al Viro , "Eric W. Biederman" , Sachin Kamat , devel@driverdev.osuosl.org Subject: [PATCH 04/10] binder: use freezable blocking calls Date: Mon, 29 Apr 2013 14:45:40 -0700 Message-Id: <1367271946-7239-5-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367271946-7239-1-git-send-email-ccross@android.com> References: <1367271946-7239-1-git-send-email-ccross@android.com> X-Gm-Message-State: ALoCoQmd/7HL4NUQTGEebQCDZa8htVhUDQMO/CkmS2WT5bnyeNEJYNiOPliWvBnQ/s7HAe2uCmvb1EW1hTIyhcIioarYp3qAIcKUz2IJ/27OFWHVOhaut5fn62ffluQs2iDWu/lsMjcwjBlOhvsDm/gBM+/cD8U5oBkhkeRPhzPCCsNbae4Pj80Smyj24CEKORpzDnMd7MsB Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Avoid waking up every thread sleeping in a binder call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- drivers/staging/android/binder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 24456a0..af8fba4 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -2140,13 +2141,13 @@ retry: if (!binder_has_proc_work(proc, thread)) ret = -EAGAIN; } else - ret = wait_event_interruptible_exclusive(proc->wait, binder_has_proc_work(proc, thread)); + ret = wait_event_freezable_exclusive(proc->wait, binder_has_proc_work(proc, thread)); } else { if (non_block) { if (!binder_has_thread_work(thread)) ret = -EAGAIN; } else - ret = wait_event_interruptible(thread->wait, binder_has_thread_work(thread)); + ret = wait_event_freezable(thread->wait, binder_has_thread_work(thread)); } binder_lock(__func__);