From patchwork Mon Sep 14 11:16:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 53544 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 8D49122B17 for ; Mon, 14 Sep 2015 11:16:44 +0000 (UTC) Received: by wisv5 with SMTP id v5sf39970837wis.0 for ; Mon, 14 Sep 2015 04:16:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:subject:to:references:cc:from :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=LmN3hLTtog+TJjKdZgcLJIyKH42xMF7X4P1a8ETpwnE=; b=Cq2W1BZrl+VtgkWbIJGzWuFIwE2MAGDhoDSah9xzSd887e/c6Nc16tc9IpZI5lAj36 ry3cKnwOcYuzJGP2BjyA4XinbmPXXX07EeJJFAm/q69I9D8J59ObfIoLlYZ+4DqbNPJO mRPeoq4wnP+y7Z68gt9iM3tVcDdlpwA5DSuv2EZlc51O3Rjwd2Waa7xGyBbJMR64sEKg t2U057LCdmqmV+FuSH7jnQpE7Xsy9PSqgSg67C63PiKxQNuGKQ19rU+Gg1LLaH+yOAAF nuEqYh/yun8Zy6dkqrYncECWnV93VZ+Ssg1CLfSODDTadu/gizt/RbU3ypCZ/QNccalQ 4qzQ== X-Gm-Message-State: ALoCoQk/bye5dYBoXnCFVAqyaAKOApIUlZlAm9JrZUIk/oN2s9ImXENjwFxOMHzm4Fl/YTB2I7sO X-Received: by 10.112.26.212 with SMTP id n20mr2936364lbg.2.1442229403883; Mon, 14 Sep 2015 04:16:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.166 with SMTP id n6ls549092laf.86.gmail; Mon, 14 Sep 2015 04:16:43 -0700 (PDT) X-Received: by 10.112.162.2 with SMTP id xw2mr13062800lbb.98.1442229403732; Mon, 14 Sep 2015 04:16:43 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id q6si6771013lah.68.2015.09.14.04.16.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 04:16:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by lamp12 with SMTP id p12so83439452lam.0 for ; Mon, 14 Sep 2015 04:16:43 -0700 (PDT) X-Received: by 10.152.28.9 with SMTP id x9mr4286154lag.73.1442229403615; Mon, 14 Sep 2015 04:16:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1136310lbq; Mon, 14 Sep 2015 04:16:42 -0700 (PDT) X-Received: by 10.50.131.232 with SMTP id op8mr3902519igb.85.1442229402378; Mon, 14 Sep 2015 04:16:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si8582216ioj.212.2015.09.14.04.16.41; Mon, 14 Sep 2015 04:16:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755076AbbINLQc (ORCPT + 2 others); Mon, 14 Sep 2015 07:16:32 -0400 Received: from foss.arm.com ([217.140.101.70]:45440 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754921AbbINLQ2 (ORCPT ); Mon, 14 Sep 2015 07:16:28 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 13CEF75; Mon, 14 Sep 2015 04:16:42 -0700 (PDT) Received: from [10.1.207.150] (e103737-lin.cambridge.arm.com [10.1.207.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C5AA33F318; Mon, 14 Sep 2015 04:16:25 -0700 (PDT) Subject: Re: [PATCH v4] pinctrl: mediatek: Implement wake handler and suspend resume To: maoguang meng References: <1439541486-22203-1-git-send-email-maoguang.meng@mediatek.com> <55DB4609.5040904@arm.com> <1441535972.22230.5.camel@mhfsdcap03> <55EEAA24.6080706@arm.com> <55EF11E6.7030307@arm.com> <1442051454.5661.12.camel@mhfsdcap03> Cc: Sudeep Holla , Daniel Kurtz , Linus Walleij , Hongzhou Yang , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , Matthias Brugger , =?UTF-8?B?WWluZ2pvZSBDaGVuICjpmbPoi7HmtLIp?= , "linux-arm-kernel@lists.infradead.org" From: Sudeep Holla Message-ID: <55F6AC87.4040301@arm.com> Date: Mon, 14 Sep 2015 12:16:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1442051454.5661.12.camel@mhfsdcap03> Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sudeep.holla@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 12/09/15 10:50, maoguang meng wrote: > hi Sudeep: > > I test flowlling your blow suggestions,but the system can not be woken. > > beacuse,mtk_eint_suspend will mask it.As we know if eint wakeup system > it must be unmasked before enter suspend flow. > > e.x > > static int __maybe_unused elan_suspend(struct device *dev) > { > struct i2c_client *client = to_i2c_client(dev); > struct elan_tp_data *data = i2c_get_clientdata(client); > int ret; > > /* > * We are taking the mutex to make sure sysfs operations are > * complete before we attempt to bring the device into low[er] > * power mode. > */ > ret = mutex_lock_interruptible(&data->sysfs_mutex); > if (ret) > return ret; > > disable_irq(client->irq); > > if (device_may_wakeup(dev)) { > ret = elan_sleep(data); > /* Enable wake from IRQ */ > data->irq_wake = (enable_irq_wake(client->irq) == 0); This is wrong assumption in the driver. enable_irq_wake doesn't implicitly enable the IRQ. So the disable_irq should be moved to else. And the resume patch also needs to be fixed accordingly, otherwise you may get unbalanced irq. But this should not be the reason for fixing the pinctrl suspend/resume. Regards, Sudeep --->8 --- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index fa945304b9a5..7de26b04f45c 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -1117,13 +1117,13 @@ static int __maybe_unused elan_suspend(struct device *dev) if (ret) return ret; - disable_irq(client->irq); - if (device_may_wakeup(dev)) { ret = elan_sleep(data); /* Enable wake from IRQ */ data->irq_wake = (enable_irq_wake(client->irq) == 0); } else { + disable_irq(client->irq); + ret = elan_disable_power(data); }