From patchwork Wed May 29 20:59:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 10968521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 594C01398 for ; Thu, 30 May 2019 09:53:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A08528B11 for ; Thu, 30 May 2019 09:53:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E82B289B9; Thu, 30 May 2019 09:53:01 +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.4 required=2.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8D74F28762 for ; Thu, 30 May 2019 09:52:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 31A0C857; Thu, 30 May 2019 10:57:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 31A0C857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1559206727; bh=4yB+HSwfq6zt2Xgwo6A42qmsefmySpd7X+Sp5QGq2nw=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=XI3l0eEA221Cgd75LwYRrxRhbbjtcJwqydEnt1K6bm49ihYSgu8zdyGR2gP29VFrl h3eurBn/lzjB48fYsM3a9E7ypMst51cVYFRCXbeARjlpc7dgxu30Yx9LdZZS84cIs3 mdxtMN8rm+3N8ECxUJJGQp6JdaS62LYVF/uClO48= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A3A1CF896EB; Thu, 30 May 2019 10:57:56 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6D52F896F8; Thu, 30 May 2019 10:57:54 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 972E6F8065A for ; Thu, 30 May 2019 10:57:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 972E6F8065A X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2019 01:57:48 -0700 X-ExtLoop1: 1 Received: from bard-ubuntu.sh.intel.com ([10.239.13.33]) by orsmga008.jf.intel.com with ESMTP; 30 May 2019 01:57:47 -0700 From: Bard liao To: broonie@kernel.org, tiwai@suse.de Date: Thu, 30 May 2019 04:59:00 +0800 Message-Id: <20190529205900.26060-1-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 Cc: liam.r.girdwood@linux.intel.com, alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [alsa-devel] [PATCH] ALSA: hda: fix: lock reg_lock before calling snd_hdac_bus_update_rirb X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Bard Liao The patch is to fix commit 5e13cf6cd64c (ALSA: hda: add polling mode in snd_hdac_bus_get_response) spin_lock_irq should be called before snd_hdac_bus_update_rirb. Signed-off-by: Bard Liao --- Takashi, Sorry, I make a mistake on the "ALSA: hda: add polling mode in snd_hdac_bus_get_response" patch. This patch is a fix for that. Thanks, Bard --- sound/hda/hdac_controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index a16ac31bda83..d6a91429c058 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c @@ -239,9 +239,9 @@ int snd_hdac_bus_get_response(struct hdac_bus *bus, unsigned int addr, timeout = jiffies + msecs_to_jiffies(1000); for (loopcounter = 0;; loopcounter++) { + spin_lock_irq(&bus->reg_lock); if (bus->polling_mode) snd_hdac_bus_update_rirb(bus); - spin_lock_irq(&bus->reg_lock); if (!bus->rirb.cmds[addr]) { if (res) *res = bus->rirb.res[addr]; /* the last value */