From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753707AbbCLLTr (ORCPT ); Thu, 12 Mar 2015 07:19:47 -0400 Received: from mga02.intel.com ([134.134.136.20]:4826 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbbCLLTp (ORCPT ); Thu, 12 Mar 2015 07:19:45 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,388,1422950400"; d="scan'208";a="691018363" Date: Thu, 12 Mar 2015 13:19:39 +0200 From: Mika Westerberg To: Doug Anderson Cc: Jiri Kosina , Andrew Duggan , Vincent Huang , Benjamin Tissoires , Dmitry Torokhov , jmaneyrol@invensense.com, borneo.antonio@gmail.com, seth.forshee@canonical.com, archana.patni@linux.intel.com, "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] HID: i2c-hid: Fix suspend/resume when already runtime suspended Message-ID: <20150312111939.GF1563@lahna.fi.intel.com> References: <1425930287-4615-1-git-send-email-dianders@chromium.org> <20150310122307.GM1563@lahna.fi.intel.com> <20150311112003.GN1563@lahna.fi.intel.com> <20150312091014.GW1563@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150312091014.GW1563@lahna.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2015 at 11:10:14AM +0200, Mika Westerberg wrote: > On Wed, Mar 11, 2015 at 08:06:47AM -0700, Doug Anderson wrote: > > Mika, > > > > On Wed, Mar 11, 2015 at 4:20 AM, Mika Westerberg > > wrote: > > > On Tue, Mar 10, 2015 at 09:12:36AM -0700, Doug Anderson wrote: > > >> Thanks for testing! Can you do a "dump_stack()" here? I'm curious > > >> why it's deciding to runtime resume. Maybe something changed between > > >> 3.14 and ToT? > > > > > > Here you go: > > > > > > [ 26.711737] i2c_hid i2c-ATML1000:00: PM: i2c-hid runtime resume > > > [ 26.711754] CPU: 3 PID: 123 Comm: sh Not tainted 4.0.0-rc3+ #6 > > > [ 26.711775] ffff88007604c600 ffff88007ba77ae8 ffffffff8183966e 0000000080000000 > > > [ 26.711791] ffff88017a83a020 ffff88007ba77b08 ffffffff816a0759 ffff88017a83a020 > > > [ 26.711804] ffff88017a83a0ce ffff88007ba77b18 ffffffff814ba3ee ffff88007ba77b38 > > > [ 26.711807] Call Trace: > > > [ 26.711835] [] dump_stack+0x4f/0x7b > > > [ 26.711852] [] i2c_hid_runtime_resume+0x29/0x50 > > > [ 26.711866] [] pm_generic_runtime_resume+0x2e/0x40 > > > [ 26.711880] [] acpi_subsys_runtime_resume+0x1f/0x23 > > > [ 26.711892] [] __rpm_callback+0x36/0x90 > > > [ 26.711902] [] rpm_callback+0x26/0xa0 > > > [ 26.711914] [] rpm_resume+0x496/0x670 > > > [ 26.711928] [] __pm_runtime_resume+0x40/0x60 > > > [ 26.711940] [] ? acpi_subsys_complete+0x1e/0x1e > > > [ 26.711951] [] acpi_subsys_suspend+0x15/0x21 > > > > > > It's the ACPI power domain that runtime resumes the device before it > > > suspends it for system sleep. > > > > OK, that explains the difference in behavior for me. I'm on an ARM > > board that has no ACPI, so there's no ACPI layer to runtime resume the > > device. > > That's interesting. So you have an ARM device with i2c-hid compatible > device connected to it? Out of curiousity, do you use DT or some > platform board file to configure the thing? > > > At least it sounds like you confirmed that my patch doesn't break your > > use case, which is good. > > I actually didn't have your patch applied yet. I just wanted to verify > that the existing code works. > > Let me know and I'll run the same test with your patch applied. I did try with the patch applied and suspend/resume worked just fine.