From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Duggan Subject: Re: [PATCH] HID: i2c-hid: Only disable irq wake if it was successfully enabled during suspend Date: Tue, 28 Jul 2015 12:55:47 -0700 Message-ID: <55B7DE43.9090008@synaptics.com> References: <1438042086-9827-1-git-send-email-aduggan@synaptics.com> <20150728113337.GD11956@lahna.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from us-mx2.synaptics.com ([192.147.44.131]:49216 "EHLO us-mx1.synaptics.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751924AbbG1Tzy (ORCPT ); Tue, 28 Jul 2015 15:55:54 -0400 In-Reply-To: <20150728113337.GD11956@lahna.fi.intel.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Mika Westerberg Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Kosina , Benjamin Tissoires On 07/28/2015 04:33 AM, Mika Westerberg wrote: > On Mon, Jul 27, 2015 at 05:08:06PM -0700, Andrew Duggan wrote: >> On at least one platform the kernel prints a warning on resume saying >> "Unbalanced IRQ 37 wake disable". This is because enable_irq_wake in the >> suspend function is failing. This patch checks to see if the call to >> enable_irq_wake succeeded before calling disable_irq_wake. > While this looks okay, I'm wondering if this can also be fixed from the > irq chip side by setting IRQCHIP_SKIP_SET_WAKE to .flags, given that the > driver does not provide such function? Yes, setting IRQCHIP_SKIP_SET_WAKE does fix the problem. After looking into it a bit more it turns out commit 5613570 already fixed the issue. My test system was running an older kernel which didn't include it. Applying 5613570 fixed this particular issue. Thanks for pointing that out, now I have a better understanding of why enable_irq_wake was failing in this instance. For this patch, I think it is still a good idea to check the return code of enable_irq_wake. In theory, an irqchip which does have a irq_set_wake callback set could return an error. I can update the commit comment, add a warning, and submit a v2. Thanks, Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752538AbbG1Tz4 (ORCPT ); Tue, 28 Jul 2015 15:55:56 -0400 Received: from us-mx2.synaptics.com ([192.147.44.131]:49216 "EHLO us-mx1.synaptics.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751924AbbG1Tzy (ORCPT ); Tue, 28 Jul 2015 15:55:54 -0400 X-PGP-Universal: processed; by securemail.synaptics.com on Tue, 28 Jul 2015 13:45:16 -0700 Message-ID: <55B7DE43.9090008@synaptics.com> Date: Tue, 28 Jul 2015 12:55:47 -0700 From: Andrew Duggan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Mika Westerberg CC: , , Jiri Kosina , Benjamin Tissoires Subject: Re: [PATCH] HID: i2c-hid: Only disable irq wake if it was successfully enabled during suspend References: <1438042086-9827-1-git-send-email-aduggan@synaptics.com> <20150728113337.GD11956@lahna.fi.intel.com> In-Reply-To: <20150728113337.GD11956@lahna.fi.intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.4.10.145] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/28/2015 04:33 AM, Mika Westerberg wrote: > On Mon, Jul 27, 2015 at 05:08:06PM -0700, Andrew Duggan wrote: >> On at least one platform the kernel prints a warning on resume saying >> "Unbalanced IRQ 37 wake disable". This is because enable_irq_wake in the >> suspend function is failing. This patch checks to see if the call to >> enable_irq_wake succeeded before calling disable_irq_wake. > While this looks okay, I'm wondering if this can also be fixed from the > irq chip side by setting IRQCHIP_SKIP_SET_WAKE to .flags, given that the > driver does not provide such function? Yes, setting IRQCHIP_SKIP_SET_WAKE does fix the problem. After looking into it a bit more it turns out commit 5613570 already fixed the issue. My test system was running an older kernel which didn't include it. Applying 5613570 fixed this particular issue. Thanks for pointing that out, now I have a better understanding of why enable_irq_wake was failing in this instance. For this patch, I think it is still a good idea to check the return code of enable_irq_wake. In theory, an irqchip which does have a irq_set_wake callback set could return an error. I can update the commit comment, add a warning, and submit a v2. Thanks, Andrew