From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754640AbbIQJFi (ORCPT ); Thu, 17 Sep 2015 05:05:38 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:53652 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754383AbbIQJFa (ORCPT ); Thu, 17 Sep 2015 05:05:30 -0400 X-AuditID: cbfee691-f79ca6d00000456a-bd-55fa825878b3 Date: Thu, 17 Sep 2015 18:05:30 +0900 From: Inha Song To: Charles Keepax Cc: lee.jones@linaro.org, broonie@kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, sameo@linux.intel.com Subject: Re: [alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed Message-id: <20150917180530.346232ce@songinha-Samsung-DeskTop-System> In-reply-to: <20150917082542.GB7694@ck-lbox> References: <1442478527-29304-1-git-send-email-ideal.song@samsung.com> <20150917082542.GB7694@ck-lbox> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWyRsSkUDei6VeowdFJ4hZXLh5ispj68Amb xb8pN9gt7n89ymhxedccNovlb/+zWZzuZnVg99jwuYnNY9OqTjaPO9f2sHnMOxno8XLibzaP z5vkAtiiuGxSUnMyy1KL9O0SuDLmH9zMVvBZpuL9jy1sDYw3xbsYOTkkBEwk7s5+xAZhi0lc uLceyObiEBJYwShxe+kkFpiihpMHWSASsxgldn7tZIJwWpgk9r34C9TCwcEioCqx/acwSAOb gIbE98+bmUFsEQELiSlLbjGD1DMLLGeUuLxoByNIvbBAnsSb/iqQGl4BV4mzN26DLeMU0JE4 0TuRHcQWEsiQ+DP/ABPEETYSq3euY4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hxgFOBiVeHgVXH6FCrEmlhVX5h5ilOBgVhLhvVILFOJNSaysSi3Kjy8qzUktPsRoCgyP icxSosn5wOSTVxJvaGxiZmRpZG5oYWRsriTOK7vyWaiQQHpiSWp2ampBahFMHxMHp1QDo7mv oIuQ+v98od02S6qdBNyT7T+8PLn76XqzyR8urnedcPH9Jw/NnytSmFoj/iza/+t3osisv2nm 3ul5j1e9N7vxkCn9r2mkslkc30GeiMtPT7k/uX3Kdq24nlh27unE/Ft7pqUmKzpM7RLeYh2p GT15mqCCdO6U2nM1m7k7Cz8/EYk80eI7Q4mlOCPRUIu5qDgRAMIqI2UGAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, It is a log: # aplay [ 79.590767] s3c64xx_spi_runtime_resume [ 79.592288] arizona spi1.0: ASRC underclocked [ 79.592331] s3c64xx_spi_runtime_suspend --- -> suspend () [ 83.348754] s3c64xx_spi_runtime_resume [ 83.367711] s3c64xx_spi_suspend [ 83.368420] PM: suspend of devices complete after 59.666 msecs [ 83.375584] arizona spi1.0: Failed to read IRQ status: -108 [ 83.375595] arizona spi1.0: Failed to read main IRQ status: -108 [ 83.375672] arizona spi1.0: Failed to read IRQ status: -108 [ 83.375679] arizona spi1.0: Failed to read main IRQ status: -108 [ 83.375749] arizona spi1.0: Failed to read IRQ status: -108 ..... [ 83.580360] Call trace: [ 83.580369] [] dump_backtrace+0x0/0x12c [ 83.580373] [] show_stack+0x10/0x1c [ 83.580380] [] dump_stack+0x78/0xc8 [ 83.580386] [] warn_slowpath_common+0x98/0xd0 [ 83.580390] [] warn_slowpath_fmt+0x4c/0x58 [ 83.580394] [] __enable_irq+0x40/0x8c [ 83.580399] [] enable_irq+0x34/0x74 [ 83.580404] [] arizona_resume+0x10/0x20 [ 83.580410] [] dpm_run_callback+0x50/0x1a0 [ 83.580414] [] device_resume+0x90/0x268 [ 83.580418] [] dpm_resume+0x120/0x350 [ 83.580422] [] dpm_resume_end+0x10/0x28 [ 83.580426] [] suspend_devices_and_enter+0x138/0x7f4 [ 83.580430] [] pm_suspend+0x314/0x5bc [ 83.580435] [] state_store+0x7c/0xf0 [ 83.580441] [] kobj_attr_store+0x10/0x24 [ 83.580448] [] sysfs_kf_write+0x40/0x4c [ 83.580452] [] kernfs_fop_write+0xb8/0x180 [ 83.580458] [] __vfs_write+0x2c/0x11c [ 83.580463] [] vfs_write+0x90/0x170 [ 83.580467] [] SyS_write+0x40/0xa0 Best Regards, Inha Song. On Thu, 17 Sep 2015 09:25:42 +0100 Charles Keepax wrote: > On Thu, Sep 17, 2015 at 05:28:47PM +0900, Inha Song wrote: > > This patch call runtiem PM function manually if the state is runtime resumed > > before enter suspend. > > > > This case has occurred when wake-up by the resume after entering to > > suspend during the playback. > > $ aplay -> runtime_resume() -> suspend() -> resume() > > > > In this case, Can occurred an error when enter suspend. > > -- > > [ 82.559234] PM: suspend of devices complete after 57.252 msecs > > [ 82.567978] arizona spi1.0: Failed to read IRQ status: -108 > > [ 82.567989] arizona spi1.0: Failed to read main IRQ status: -108 > > [ 82.568027] arizona spi1.0: Failed to read IRQ status: -108 > > [ 82.568036] arizona spi1.0: Failed to read main IRQ status: -108 > > Would it be possible to get some more detail on what is happening > here? A full log would be nice with DEBUG enabled in > arizona-core.c, also perhaps put some printk's in the SPI driver > suspend/resume as well. > > It looks like what is happening is that the system is attempting > to handle an IRQ before the SPI has been resumed. But that is > exactly what the irq enables/disables in the system PM ops in > Arizona are trying to avoid. > > > .... > > So, we should call runtime_suspend() manually when enter suspend > > if the state is runtime resume. > > There are many use-cases where we want to leave the CODEC enabled > whilst the system is suspended so we really don't want to be > doing a runtime suspend with every system suspend. > > Thanks, > Charles