From patchwork Sat Dec 16 01:12:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 10116763 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 84B7A6019C for ; Sat, 16 Dec 2017 01:12:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7673F2A181 for ; Sat, 16 Dec 2017 01:12:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A9862A1EF; Sat, 16 Dec 2017 01:12:51 +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 6E13F2A181 for ; Sat, 16 Dec 2017 01:12:50 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 82FA5266DD5; Sat, 16 Dec 2017 02:12:47 +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 50FAA266DE0; Sat, 16 Dec 2017 02:12:46 +0100 (CET) Received: from mail-it0-f65.google.com (mail-it0-f65.google.com [209.85.214.65]) by alsa0.perex.cz (Postfix) with ESMTP id 2AEC7266DB1 for ; Sat, 16 Dec 2017 02:12:42 +0100 (CET) Received: by mail-it0-f65.google.com with SMTP id f143so22051404itb.0 for ; Fri, 15 Dec 2017 17:12:42 -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=qJSJELdB6SqfPl8ofyMa6Oo7PASL8tOEQW++9g8icWI=; b=ULkGI1kLornm/8VcAjNhoML2VqCR+BuEP/n1IXhfsR5VPTtwA+4IUOlPM1mGSm6MFq kZU3B1NFUYyoXlsPHqK36tWwiNGteJ76rzfNCDFXQnBVR/sDR3dkdIv/W0KI20Zit7fB gTm2XjMf6N1oh+BK+6GNGFcAF8W4rDSA3CCGU= 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=qJSJELdB6SqfPl8ofyMa6Oo7PASL8tOEQW++9g8icWI=; b=dmnuITURtupDRnUxmfaJeNUmPe7oDF6yUfEjhKN27eK9DJZwsvmlIgBgPDIsYrTQu3 ryyiWqJm6kU4ao8THfVVqyal38QaJ8a64HEca084BuvmLnOie6zwtJajV1tcSNiZLSiW fricn3nIlQfJGoWbSyvBd2RHPsL4A9mXEE6qC3u3i6BhQmRfrJq9JrpkVS3vyfQ+TJPQ UzDf2foyeWXpNQlS4Lu7QScRRaBYxHxapp8cmDZLYLDlnBA3OxwNhU8S86GTJ7Hj/EGr yT63pLEb8JAAIiNHPx/xJVuBFmpWrV/XwpGVaECivO+uwwJjZWfuhbzMDhUowRNQAMjU +HLA== X-Gm-Message-State: AKGB3mLT1cevdlN+MhlvcVaXFXr2I25CnCIwh993eyjlLXuuLQhPJV/y FECVAJz2Tu/WEDzCSibfgwv00A== X-Google-Smtp-Source: ACJfBou8bIIOHrl564AmbXbHg4rCqlJSgI7sfFspScengCY6n8Tv3XHzaHa7JwKDD+lNztfC/EYy3w== X-Received: by 10.36.89.149 with SMTP id p143mr10733073itb.96.1513386761644; Fri, 15 Dec 2017 17:12:41 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id g79sm4404810itb.29.2017.12.15.17.12.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 17:12:40 -0800 (PST) From: Brian Norris To: Oder Chiou , Bard Liao , Liam Girdwood , Mark Brown Date: Fri, 15 Dec 2017 17:12:30 -0800 Message-Id: <20171216011230.107527-1-briannorris@chromium.org> X-Mailer: git-send-email 2.15.1.504.g5279b80103-goog Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Brian Norris , Takashi Iwai Subject: [alsa-devel] [PATCH for-4.15] ASoC: rt5514: don't assume rt5514 component was "attached" 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 I've found that on Google's "Kevin" Chromebook, the rt5514 codec might not be set up completely, yet its device is still present, and therefore its PM suspend/resume is called. This hits a NULL pointer exception, since we never had the chance to set our drvdata pointer. This resolves crashes seen when trying to resume my system. Fixes: e9c50aa6bd39 ("ASoC: rt5514-spi: check irq status to schedule data copy in resume function") Signed-off-by: Brian Norris --- This is a v4.15-rc1 regression sound/soc/codecs/rt5514-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index 2df91db765ac..9255afcf2c3a 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -482,7 +482,7 @@ static int __maybe_unused rt5514_resume(struct device *dev) if (device_may_wakeup(dev)) disable_irq_wake(irq); - if (rt5514_dsp->substream) { + if (rt5514_dsp && rt5514_dsp->substream) { rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf)); if (buf[0] & RT5514_IRQ_STATUS_BIT) rt5514_schedule_copy(rt5514_dsp);