From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754682AbbIQIt3 (ORCPT ); Thu, 17 Sep 2015 04:49:29 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:54741 "EHLO mx0a-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754667AbbIQItY (ORCPT ); Thu, 17 Sep 2015 04:49:24 -0400 Date: Thu, 17 Sep 2015 09:25:42 +0100 From: Charles Keepax To: Inha Song CC: , , , , , Subject: Re: [alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed Message-ID: <20150917082542.GB7694@ck-lbox> References: <1442478527-29304-1-git-send-email-ideal.song@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1442478527-29304-1-git-send-email-ideal.song@samsung.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-09-17_04:2015-09-17,2015-09-17,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1508030000 definitions=main-1509170159 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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