From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752883AbbIKMoA (ORCPT ); Fri, 11 Sep 2015 08:44:00 -0400 Received: from foss.arm.com ([217.140.101.70]:37961 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752227AbbIKMn6 (ORCPT ); Fri, 11 Sep 2015 08:43:58 -0400 Subject: Re: [PATCH v4] pinctrl: mediatek: Implement wake handler and suspend resume To: =?UTF-8?B?Q2h1bmctWWloIFdhbmcgKOeOi+W0h+aHvyk=?= 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> Cc: Sudeep Holla , maoguang meng , Hongzhou Yang , Linus Walleij , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , Matthias Brugger , Yingjoe Chen , "linux-arm-kernel@lists.infradead.org" From: Sudeep Holla Message-ID: <55F2CC88.3030304@arm.com> Date: Fri, 11 Sep 2015 13:43:52 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/09/15 12:22, Chung-Yih Wang (王崇懿) wrote: > Hi Sudeep and Maoguang, > > Please correct me if I am wrong. I think the wake_mask Maoguang > implemented is the wake-up configuration and it is how he disabled > other unwanted interrupt sources(e.g. audio jacket insertion) during > suspend. > OK, you are right, I think I now understand the issue. I misread the code initially thinking the suspend/resume are implemented as syscore_ops but they are standard device pm ops. > With Sudeep's patch which we had similar one before, the system got > waken up by audio jack insertion which we don't want. Maoguang tried > to implement wake_mask as the wake-up configuration to keep track of > effective wakeup sources(i.e. those who makes enable_irq_wake) and > write the wake-up configuration in mtk_eint_suspend(). What is your > suggestion to address this issue? Thanks! > One option is to convert them to *_noirq callbacks assuming all the users of this pinctrl irqchip have sanely implemented their suspend/resume and don't trigger interrupts between dpm_suspend and suspend_device_irqs. What do you think ? Regards, Sudeep ---->8 @@ -1130,8 +1130,8 @@ static int mtk_eint_resume(struct device *device) } const struct dev_pm_ops mtk_eint_pm_ops = { - .suspend = mtk_eint_suspend, - .resume = mtk_eint_resume, + .suspend_noirq = mtk_eint_suspend, + .resume_noirq = mtk_eint_resume, };