From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756638AbdLPEHi (ORCPT ); Fri, 15 Dec 2017 23:07:38 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:37734 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756152AbdLPEHh (ORCPT ); Fri, 15 Dec 2017 23:07:37 -0500 X-Google-Smtp-Source: ACJfBot63yzWJzTjXS/pDBFuolvTstXg8JQW/u+Pz9nH6DPPBycF/ZD9G3Z01vXRqad4v4cINuQgDQ== From: Brian Norris To: Oder Chiou , Bard Liao , Liam Girdwood , Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Matthias Kaehlcke , Jeffy Chen , linux-rockchip@lists.infradead.org, Jimmy Cheng-Yi Chiang , Brian Norris Subject: [PATCH for-4.15] ASoC: rt5514-spi: only enable wakeup when fully initialized Date: Fri, 15 Dec 2017 20:07:23 -0800 Message-Id: <20171216040723.11710-1-briannorris@chromium.org> X-Mailer: git-send-email 2.15.1.504.g5279b80103-goog Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If an rt5514-spi device is probed but the platform hasn't linked it in, we might never fully request the SPI IRQ, nor configure the rt5514 DSP, but we still might try to enable the SPI IRQ (enable_irq_wake()). This is bad, and among other things, can cause the interrupt to trigger every time we try to suspend the system (e.g., because the interrupt trigger setting was never set properly). Instead of setting our wakeup capabilities in the SPI driver probe routine, let's wait until we've actually requested the IRQ. Fixes issues seen on the "kevin" Chromebook (Samsung Chromebook Plus). Fixes: 58f1c07d23cd ("ASoC: rt5514: Voice wakeup support.") Signed-off-by: Brian Norris --- The patch that introduced the wakeup was in 4.15-rc1. I think this qualifies as a bugfix, and should probably go into 4.15. Other relevant patches that are useful, and fix similar (or the same) issues: https://patchwork.kernel.org/patch/10067725/ [PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink https://patchwork.kernel.org/patch/10116761/ [PATCH for-4.15] ASoC: rt5514: don't assume rt5514 component was "attached" sound/soc/codecs/rt5514-spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index 9255afcf2c3a..48e4b9002caf 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -289,6 +289,8 @@ static int rt5514_spi_pcm_probe(struct snd_soc_platform *platform) dev_err(&rt5514_spi->dev, "%s Failed to reguest IRQ: %d\n", __func__, ret); + else + device_init_wakeup(rt5514_dsp->dev, true); } return 0; @@ -456,8 +458,6 @@ static int rt5514_spi_probe(struct spi_device *spi) return ret; } - device_init_wakeup(&spi->dev, true); - return 0; } -- 2.15.1.504.g5279b80103-goog