From patchwork Tue Aug 14 15:21:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 144184 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4493896ljj; Tue, 14 Aug 2018 08:21:41 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwb6u1Sxk+X1EPp4tBJm574/PzulNLwQwLyTQ0B4XEhDMTmBjwm4mxDsMKw3TfLYQSMCAiY X-Received: by 2002:a5d:4e92:: with SMTP id e18-v6mr14554465wru.32.1534260101272; Tue, 14 Aug 2018 08:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534260101; cv=none; d=google.com; s=arc-20160816; b=NEB2gGdHeL3/tLpMdDs7+Xlj0MuTzXbzFreiF3nzPxVzNuirTDGJDAifxWCWYMIEEg FBsjkyqMuXdzrGH0XhhPpomV0fKbYQtkiQ02tmZ9Nn9plGS2dRMa2+sK4+rid+/Pw/0s AURV4d4d/FhoIGp6vFqYV6eauys60ya6gMheonkeuq3uM1b6sSefFZsMaLdonRPtqzVy GC2T6biq8XusrwXFi+6ya74rOthbPWS0kXCNPq4Gg8Maz56256tktxjXbmP8p67YNnsC GjpupuwZHsFszqFECE1pR+NtENn7qJiKwgNPpY126FMgSWBMqOBkI6XSuFMCq+80rc/Z /nfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=lGiXreLwbpo94rDRMpAkt5lFt51C3NrgYsparrlr/UY=; b=Qw563xJkTol8LxazGY5io7EUURHWV9cT15On+FZYTQUCU61T/jrU5MVmtnnkQ7SjMW Q8bhZYKOW4LBZpFZqXzJJPjhxwMXpbc/Ecm6iOwPb2KPJ1XfDPk7MO/qJ/TmCJDl2uGe gPmbEvyPd+CDtevqPb1TSH5z4T08ZSKR10X+Eg1sbHJqMPGOlwbacjUGiWms/6O89eYU C92v4WaG/kav20plknksiizNLy2cbDb8UsqOBJ3MX3k/NMfyn880p+m8pyBLLIdbbOex A+/+bKEYEJXINU4egENzdCpewIIRVYKs88uuWTW4rgkXOr8K5jEZh9cTv2E1ICjBRjP9 uSoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=ujjT3gSx; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id h1-v6si14200459wrw.378.2018.08.14.08.21.41; Tue, 14 Aug 2018 08:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=ujjT3gSx; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4B75226780B; Tue, 14 Aug 2018 17:21:37 +0200 (CEST) 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 8C09B267812; Tue, 14 Aug 2018 17:21:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id BA5522677A8 for ; Tue, 14 Aug 2018 17:21:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=7iJFPY/hR83MCtcL4BvgFt7ZSNsp2U00lOQWYob2+Ag=; b=ujjT3gSxoLfF HH5ji7/mG5kRGxiutJ+H8H9YkB9wnCRk5GoVBK36aDmXRjTTGqLHftnptwpqt4F/lROHUVfaNzmdA 2QhAUYomW7h9l+qEuDDFTBrr8zINBXjsGJYjhhn1ahYrKt/yTUecpUxUS+HUauA5yZwtULNXTKYQN Ox/Qk=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fpb8U-0000ud-5y; Tue, 14 Aug 2018 15:21:30 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id D83071124449; Tue, 14 Aug 2018 16:21:29 +0100 (BST) From: Mark Brown To: Yong Zhi In-Reply-To: <1534202114-29164-1-git-send-email-yong.zhi@intel.com> Message-Id: <20180814152129.D83071124449@debutante.sirena.org.uk> Date: Tue, 14 Aug 2018 16:21:29 +0100 (BST) Cc: wenkai.du@intel.com, alsa-devel@alsa-project.org, harshapriya.n@intel.com, yang.jie@linux.intel.com, pierre-louis.bossart@linux.intel.com, liam.r.girdwood@linux.intel.com, vkoul@kernel.org, broonie@kernel.org, michal.wasko@intel.com, naveen.m@intel.com, sanyog.r.kale@intel.com Subject: [alsa-devel] Applied "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" to the asoc tree 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 The patch ASoC: Intel: Skylake: Acquire irq after RIRB allocation has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 12eeeb4f4733bbc4481d01df35933fc15beb8b19 Mon Sep 17 00:00:00 2001 From: Yong Zhi Date: Mon, 13 Aug 2018 18:15:14 -0500 Subject: [PATCH] ASoC: Intel: Skylake: Acquire irq after RIRB allocation Cold reboot stress test found that the hda irq could access rirb ring buffer before its memory gets allocated which resulting in null pointer dereference inside snd_hdac_bus_update_rirb(). Fix it by moving the skl_acquire_irq after ring buffer allocation. While here, also change err return from -EBUSY to actual error code. Signed-off-by: Yong Zhi Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index dce649485649..cf09721ca13e 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -838,11 +838,7 @@ static int skl_first_init(struct hdac_bus *bus) snd_hdac_bus_parse_capabilities(bus); - if (skl_acquire_irq(bus, 0) < 0) - return -EBUSY; - pci_set_master(pci); - synchronize_irq(bus->irq); gcap = snd_hdac_chip_readw(bus, GCAP); dev_dbg(bus->dev, "chipset global capabilities = 0x%x\n", gcap); @@ -875,6 +871,12 @@ static int skl_first_init(struct hdac_bus *bus) if (err < 0) return err; + err = skl_acquire_irq(bus, 0); + if (err < 0) + return err; + + synchronize_irq(bus->irq); + /* initialize chip */ skl_init_pci(skl);