From patchwork Sat Dec 16 04:07:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 10116831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DE9B6019C for ; Sat, 16 Dec 2017 04:16:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52CE6290F2 for ; Sat, 16 Dec 2017 04:16:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43CE4292D2; Sat, 16 Dec 2017 04:16:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B450290F2 for ; Sat, 16 Dec 2017 04:16:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E3272266F3E; Sat, 16 Dec 2017 05:07:42 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EDD85266F51; Sat, 16 Dec 2017 05:07:40 +0100 (CET) Received: from mail-io0-f194.google.com (mail-io0-f194.google.com [209.85.223.194]) by alsa0.perex.cz (Postfix) with ESMTP id 518C0266B0F for ; Sat, 16 Dec 2017 05:07:37 +0100 (CET) Received: by mail-io0-f194.google.com with SMTP id x129so4680897iod.13 for ; Fri, 15 Dec 2017 20:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=p5xhY7rONjMYTjJt5QhYphsyR+zIxS15ySk+CGHSFYk=; b=GxOBYrXgCYG80liIGwteGv/u+LGNf4lSudc5CIt6Qwxv6QOz4rHIAogfeA1WDPFfTa XpXGcMnpSi3dDXXDTmuf0DTSKwfrTw2j/kvONJbaF4MPj1d0QZ7dHrtuDH+g5fOcST23 LnJ2kR/HNjoSV4P6F/L78+7cEmvn3/koism88= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=p5xhY7rONjMYTjJt5QhYphsyR+zIxS15ySk+CGHSFYk=; b=r4sEfktMosELWUs5+4nSlfKuMnW+xaoyybf+A101lA1d8MElLHgGiMqBAHPAQvbz5j 0JWJNxmdGa2bUNxpc89LPF8ArAcWMBgUd56vicwnEUlVrd4sJUPChlUd3EW1w0Kae24g /xUSAIl3/KY5HwoxwbHEA4IVbTh8nUyTT86PgXSwW79YSqLZcNhDg/9trK4o9r66CSjW dsoE00iJYfRjzPJK6VejzbnfOdaEFSR6hP1qLWmr1osqCUGIvbFSvw/OnS4uUONj/3eN ECuNLPi3eiWzWWbkiFmeDurVrrlbE1hRiDMJu07w51sGdwc7usosa4xags5VN4ql7cim vb2w== X-Gm-Message-State: AKGB3mJNRvFp1r/4flgC9xHQFudFAqJpef1wdZwsd6U4HES5ZvJ1le2X a/PgqEjLdr/YmjHdY/8AhSCxeA== X-Google-Smtp-Source: ACJfBot63yzWJzTjXS/pDBFuolvTstXg8JQW/u+Pz9nH6DPPBycF/ZD9G3Z01vXRqad4v4cINuQgDQ== X-Received: by 10.107.180.145 with SMTP id d139mr5600583iof.113.1513397256952; Fri, 15 Dec 2017 20:07:36 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id 74sm1696930ioq.82.2017.12.15.20.07.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 20:07:36 -0800 (PST) From: Brian Norris To: Oder Chiou , Bard Liao , Liam Girdwood , Mark Brown 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 Cc: alsa-devel@alsa-project.org, Brian Norris , Jimmy Cheng-Yi Chiang , Jeffy Chen , linux-kernel@vger.kernel.org, Takashi Iwai , linux-rockchip@lists.infradead.org, Matthias Kaehlcke Subject: [alsa-devel] [PATCH for-4.15] ASoC: rt5514-spi: only enable wakeup when fully initialized X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }