From patchwork Mon Mar 25 22:18:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13603091 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0237170CC2 for ; Mon, 25 Mar 2024 22:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711405116; cv=none; b=lNx9hwg6t94Kaei9Os0lbMIrJuTIV1xMFeQhscdpKoSdMPlkiEYoke/FBcWo3HVJL5cPIMy1bkLMSvFjqhWKCj5x15LrH2Ye4+GhEmBG4t17USJlSlbhlRuuYTMMkOw0KRpKDWv0Y9J4NXKvabld8/7mG+WYEC4vhEUNp1Da8aU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711405116; c=relaxed/simple; bh=kd/auYdKSh0XhuIhPDGz+jnB9z4PlnfnynJ81G4qQKc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H43QJSEsPYAJWe3o/1kLV1ZZgIgjvOa40ubZHmymFLIHhhdDZ3O+X9KfYYzZy18YZSdM8io4Ap7UmujYWzR8vTJMFnBODVQqlpzA11gbxX9J8VzdT/Bc4VwiJ5ftE5t7lN91UX2/YHmzTxB0J9uaSaYv0TBS5E9uj8oePpjgp1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iq+GLQJS; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iq+GLQJS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711405115; x=1742941115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kd/auYdKSh0XhuIhPDGz+jnB9z4PlnfnynJ81G4qQKc=; b=iq+GLQJSy9FrKxwcMdmgvkLHNAHcVX9mMoEWqoP1TVNlPEHNhIQSkyUK 6Q4KKeoiHlFla1q0gTnPDDFNOqqi+LOlUv/OxIndU+RHujeg3oevjRyn7 x2gj7zuVhkBOnNnYI/8HhSKlKxDFWm+dYlSdXlgudjwV57Q+koXAeAN51 1a8xY30IP5uqYQdFyJMNyRXSt94czD/LzvdlK1BI30sFhCSNiqhHejwKk KfTGf/GYDCmgzmRsHyIOMkKXivheINLiP6+/pMmIXbOTbDIhhZmYgT5QA mmhAPiEgQ+xKkKBg9ch4MEp8dQJ8mT+2Ep2pd5FMG6iCQi2cnLYO+baE7 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11024"; a="6300383" X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="6300383" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2024 15:18:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="20309648" Received: from jaimbres-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.lan) ([10.212.98.109]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2024 15:18:33 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao , Chao Song Subject: [PATCH 5/6] ASoC: rt722-sdca-sdw: fix locking sequence Date: Mon, 25 Mar 2024 17:18:16 -0500 Message-Id: <20240325221817.206465-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240325221817.206465-1-pierre-louis.bossart@linux.intel.com> References: <20240325221817.206465-1-pierre-louis.bossart@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The disable_irq_lock protects the 'disable_irq' value, we need to lock before testing it. Fixes: a0b7c59ac1a9 ("ASoC: rt722-sdca: fix for JD event handling in ClockStop Mode0") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Chao Song --- sound/soc/codecs/rt722-sdca-sdw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt722-sdca-sdw.c b/sound/soc/codecs/rt722-sdca-sdw.c index eb76f4c675b6..65d584c1886e 100644 --- a/sound/soc/codecs/rt722-sdca-sdw.c +++ b/sound/soc/codecs/rt722-sdca-sdw.c @@ -467,13 +467,13 @@ static int __maybe_unused rt722_sdca_dev_resume(struct device *dev) return 0; if (!slave->unattach_request) { + mutex_lock(&rt722->disable_irq_lock); if (rt722->disable_irq == true) { - mutex_lock(&rt722->disable_irq_lock); sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_6); sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8); rt722->disable_irq = false; - mutex_unlock(&rt722->disable_irq_lock); } + mutex_unlock(&rt722->disable_irq_lock); goto regmap_sync; }