Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1623932rwd; Mon, 15 May 2023 00:07:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5f3kp2tvvDqaO7W+5FlDourat+3AbsnG9DANatPeb7eTyLeD52fUiGYf+Vnhb1uX6glWC4 X-Received: by 2002:a17:903:1247:b0:1ac:3605:97ec with SMTP id u7-20020a170903124700b001ac360597ecmr43440120plh.62.1684134476416; Mon, 15 May 2023 00:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684134476; cv=none; d=google.com; s=arc-20160816; b=a6kEDvDDp6JIoeCBBxOaHmnagwdHZ4RthcJJzOKE4PZNG+1pm1XyKjGTPnCLgFrN0U aErz9pnZWb33uBWgOirawSMMrUsTsZQcUx7ScbMC7TJMKshc96KiyrQh+NmZRcjNm8i3 E2Jq0OWIm8UbiwABQhdVGEdsncTpN1NNmg1atPGTo+qYjNPG/mvRHBEosGXdHlZ0zguv +uhrTUI4vcQcuGxVsYa7wd+xqhQuOEn9TV5IT9Nf6ICggeUmG6XKJarlfNEZ/1K9j0RZ KMrv47eZNeAJmt6oA47y35nAr4UWdoPUOtQybOhUzHdUC6B1GYcpMnsbB5omu+YVB6rc RScw== 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=egEOeknk3ct5mrQBAPnSZnHykbXok01mTcCxV3XOUdI=; b=obW4AaiSY3aMM8L3KmdxQUhRw5pW++AXdl40D68lb+FRMEdQFGJlCf633WOa3Qj3d6 jDuh1On+29pbn+9CFBczGA+cUR2X/q3rvO545mhIjkN9B1L6LWhCZ7e/Qy9ihlmc2++i cY3fRB36dstxfUu5UU3QGpq/YiH9mIGBovmq9rMiA9/7XvrakuluVZpI3WrhopS5CETe ZV4aXswAFTQNy7+7o7Zwhe3LVDjH7H709AfYXKR55uHtAQCNK0B68u3snfds0YIQdp75 gN14BG8Ud1CQ3fBsZQBINurm6UAbMpt8APfWAsXYetHJFOHJzFls6GWJAMOw/Z8YIbCn gD1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G9lxGxSw; 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 z10-20020a17090acb0a00b0025287b1f177si10522555pjt.9.2023.05.15.00.07.41; Mon, 15 May 2023 00:07:56 -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=G9lxGxSw; 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 S240305AbjEOGu5 (ORCPT + 99 others); Mon, 15 May 2023 02:50:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240170AbjEOGus (ORCPT ); Mon, 15 May 2023 02:50:48 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CDE72699 for ; Sun, 14 May 2023 23:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684133438; x=1715669438; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xKsOmGgpfRTaoYi/C0Rex9lD4JYFMvLzVqkjtEvqo9k=; b=G9lxGxSw372a26MCw7DfcNPWonstBGIqWG1Rvv0liJ+h1tginpiDrVKY YVbasQqng62u0zT33XIEtAB/KoJdN1goq3YFListrqGYT/EXNoVOUXSd7 h5dtdFVl2wETI1ymY1yQZdmFlf9OZ7XejBMVJzQIUXzWWuHN7HxIeNbsE ZkU0Fh/z3/OAjzSZZGfaxxLkC0X4uaXMGwjdaDZYbQb/wn0qbIANCRzif 3Br/5IVqnsF+fZkoHINikTUfsLZg1n/yACQmO5PPvT/lToI1/NIZHfnA2 LuLlKa0jj/LGI8Q3s7DeOg98iBh0o1s3cLbmR32f37Xq14AV3qMytz13a A==; X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="349966331" X-IronPort-AV: E=Sophos;i="5.99,275,1677571200"; d="scan'208";a="349966331" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2023 23:50:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="694908641" X-IronPort-AV: E=Sophos;i="5.99,275,1677571200"; d="scan'208";a="694908641" 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; 14 May 2023 23:50:35 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org, broonie@kernel.org, tiwai@suse.de Cc: linux-kernel@vger.kernel.org, vinod.koul@linaro.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH v2 07/26] soundwire: intel: add eml_lock in the interface for new platforms Date: Mon, 15 May 2023 15:10:23 +0800 Message-Id: <20230515071042.2038-8-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230515071042.2038-1-yung-chuan.liao@linux.intel.com> References: <20230515071042.2038-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=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 In existing Intel/SoundWire systems, all the SoundWire configuration is 'self-contained', with the 'shim_lock' mutex used to protect access to shared registers in multi-link configurations. With the move of part of the SoundWire registers to the HDaudio multi-link structure, we need a unified lock. The hda-mlink implementation provides an 'eml_lock' that is used to protect shared registers such as LCTL and LSYNC, we can pass it to the SoundWire side. There is no issue with possible dangling pointers since the SoundWire auxiliary devices are children of the PCI device, so the 'eml_lock' cannot be removed while the SoundWire side is in use. This patch only adds the interface for now. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- include/linux/soundwire/sdw_intel.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h index c4281aa06e2e..bafc6f2554b0 100644 --- a/include/linux/soundwire/sdw_intel.h +++ b/include/linux/soundwire/sdw_intel.h @@ -327,6 +327,8 @@ struct sdw_intel_ctx { * @alh_base: sdw alh base. * @ext: extended HDaudio link support * @hbus: hdac_bus pointer, needed for power management + * @eml_lock: mutex protecting shared registers in the HDaudio multi-link + * space */ struct sdw_intel_res { const struct sdw_intel_hw_ops *hw_ops; @@ -343,6 +345,7 @@ struct sdw_intel_res { u32 alh_base; bool ext; struct hdac_bus *hbus; + struct mutex *eml_lock; }; /* -- 2.25.1