Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp2352371qtg; Wed, 22 Mar 2023 22:32:17 -0700 (PDT) X-Google-Smtp-Source: AK7set+NEr7s34tQfArOEnTNHC3sUrDsMx7sFjGbwmaCzR096UfW0uL+/Wn2uqctcZO7gmYQOZEb X-Received: by 2002:a17:90b:3b46:b0:23b:50ff:59ba with SMTP id ot6-20020a17090b3b4600b0023b50ff59bamr6453036pjb.21.1679549536820; Wed, 22 Mar 2023 22:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679549536; cv=none; d=google.com; s=arc-20160816; b=ioYeDFf5Qpn0EE4ZnnKLJdBTI8mUDEenWWa1D8/cqMCjISZgwwS+OvhB70npifH3jX cCGLM8DbE8iWP/PIYjkZ7OKPmjoyOxl/vpoz+nrFKrqT/vTxFuSLbOnkGCseHfkNXb0Z 7ptpFUPQJMVN3muOLgT+J4mUlt/Y2T4G9YIi7i7SbVhlgu/so5vk9LY/15jxakFY4o9O T/MXYSR9/5MghLOdbNeGnKTA75cDqqRQEjsaF4cm24ELrqM+WWQXiU+yQnUKWy+/4UCE G3keYCY7CvBnA4a2foYhalgBpdJA41jk0L+HWlFbRe1LNIKeG4FAX+tyynUWeDI4CECO rWkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=luo+B86recPF5J8Y5vjuQIsNA3y0l6dAIysXdnm2nHU=; b=h1Im9OYIQ65ya7xgl6XpunnRsYCyUbyrvHOKapT8hsXeLVzPBUYR5H4zgs4fKTi0OK 2xgTG54EsiQtDZvmu4VXVqiEwZ/bIji9QwMM0Z2DxdDx3M5REJ4f1abVD7gT+0mArLxC ns5L0EMxaauI5Rg1pTuIedUL9rkvi8OZwpUoKuY0dWF9uklpzAqnHbjKLXZ54rVZu8HG vjO0VuBf262qNy8OjAqcokW7E4RsTXRZpFIaCVe2d0nP8i2bXG5gRLNhnsPUlBTcxCVL U13XbJzpahRTzCb4Arxbg/TToqq6QWWJpvkNXxRpFgxTJCZRFVy7cmiIkC2Bs0h/hW1l amdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GHsjtBTO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a6560d4000000b004fba0f483c8si17497121pgv.185.2023.03.22.22.32.05; Wed, 22 Mar 2023 22:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GHsjtBTO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbjCWFbR (ORCPT + 99 others); Thu, 23 Mar 2023 01:31:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbjCWFaz (ORCPT ); Thu, 23 Mar 2023 01:30:55 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFF1D22119 for ; Wed, 22 Mar 2023 22:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679549448; x=1711085448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TZ+6Ux/vWHTp7+2fBxz2s/j5BxjCv70QKxkw1tIhFkw=; b=GHsjtBTOxfMgiFv8Yf0JjqlDtNlK4smNm1ct+KsC38fJe0Rv9mcUF8eT 8qQsV8U9S83HqHqswh29bZPzPrmkdXBEaEMcMCz6La4J/ueT6lvF/gMCe +DJQXRRrMoqgjKT8q4x0eoi6Do3SikrRi5l3TY0qtMyXhgUtd6bfOWw1j hvLSTIJVnjWY3JN8i9ugu7hrOrIq6nhGnBwWzqoVt9ARfBZIA6dyvv9gl GptjFWg1e/hR2Bkl6Fm8uN3rpslnTfOZ/X5pNooaGlOirwJDt9RLBKFdi FSYPPlo4b1K5v/cfRJsHQe22MscKHT8alckOmB6VC4bYr1qmt1Xyesszr A==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="327779370" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="327779370" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 22:30:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="675567055" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="675567055" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 22:30:08 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org, broonie@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, tiwai@suse.de Subject: [PATCH 08/20] ASoC: SOF: Intel: hda: retrieve SoundWire eml_lock and pass pointer Date: Thu, 23 Mar 2023 13:44:40 +0800 Message-Id: <20230323054452.1543233-9-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230323054452.1543233-1-yung-chuan.liao@linux.intel.com> References: <20230323054452.1543233-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart Use new helper and interface to make sure the HDaudio and SoundWire parts use the same mutex when accessing shared registers. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- sound/soc/sof/intel/hda.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 22eba57bb3e6..f8cd5a9ebad1 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -215,6 +215,15 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev) res.alh_base = hdev->desc->sdw_alh_base; res.ext = false; } else { + /* + * retrieve eml_lock needed to protect shared registers + * in the HDaudio multi-link areas + */ + res.eml_lock = hdac_bus_eml_get_mutex(sof_to_bus(sdev), true, + AZX_REG_ML_LEPTR_ID_SDW); + if (!res.eml_lock) + return -ENODEV; + res.mmio_base = sdev->bar[HDA_DSP_HDA_BAR]; /* * the SHIM and SoundWire register offsets are link-specific -- 2.25.1