Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp2352366qtg; Wed, 22 Mar 2023 22:32:16 -0700 (PDT) X-Google-Smtp-Source: AK7set/4tfKNG7dDqDseym9IPqISTE06uJjW7Z4NrONQTGkaiP14dObBkc6EV6c8FgH8XGxoRczn X-Received: by 2002:a17:90a:190f:b0:23f:1143:a6f8 with SMTP id 15-20020a17090a190f00b0023f1143a6f8mr6452471pjg.33.1679549535701; Wed, 22 Mar 2023 22:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679549535; cv=none; d=google.com; s=arc-20160816; b=LrMim/ew37AlYOJ1Yy+pn/f6hVhTbPmN7J0+cuJTaV3+lhQR6HQLXiM/b8bSXWOJ5t bNiFnxu1e3Es8JYKD9u8JWybqonstHxAW/Q5dWMyR/Ppg/Aag+yzRBGPMGNlQdHaiTAv vaDJpd6wCdsDG6yii4grcFW5gVxq6//knhnUR0xWVC12vgF/z/q/sAhOqBoZFkKoYTs1 xE0K/OVLBnZ/yLFCxCiymY8ShYePiFym2qREwkFLgzeOGeMNJXN/2aEb780cuJQLYams WIxqNNABFrJOEQm8to6nsa4EibnpPoJEL0x2KL+aSOAxHaWYo1qYVGN8i/lORU0KXbGe S3DA== 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=ycwtCnoCb2BS/NqPEvdhcgF7B4K0r8g/7pQ6bAchTHMJHTSJIj8sEBZmkgc1DM5IRt Ycse9rw/NglAhnJ7/ODBElKTwmmEy7ytFYOmSi3hU9usbruNM/vyvNFNkyVYbiUWrbBh KLVKDdtdp0YorgAyPnX8vkdkMgdF52z7as3grhH7QGdDstMROKOwQELnlBGJmzpfqdRX OZM7TKy1lN73RdQ4r+qAXphkY98C04GfZKnX2kUYHlffqa4pT/O+k27ImMZi77EydKq6 xPyA4ISU8l8qi5N3OOWmVvkVOao0w/QyNSCJHr9VdKOrSAjEYxHgQm9kZVAO+dtajzv3 ihlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="fe/uTfUe"; 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 jd19-20020a170903261300b0019f3c06fdfasi16790157plb.339.2023.03.22.22.32.03; Wed, 22 Mar 2023 22:32:15 -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="fe/uTfUe"; 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 S230426AbjCWFbI (ORCPT + 99 others); Thu, 23 Mar 2023 01:31:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbjCWFat (ORCPT ); Thu, 23 Mar 2023 01:30:49 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 214A520D04 for ; Wed, 22 Mar 2023 22:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679549437; x=1711085437; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xKsOmGgpfRTaoYi/C0Rex9lD4JYFMvLzVqkjtEvqo9k=; b=fe/uTfUezvkcNRFqw+G61L1hrEw/ZoGFcKh+V7ldpZPaY3OqqCIoW0js +gIruqpJTD2VcVXjNJSjWQ6eak265wLCIwzv7qzKtTlO+bNLrGEsdai5l CoDsCrEoJStvCsTNggAajj7Ua/168SjXPrNELTTVHxQrtDNpNDCcEUcje r9vtszwD8p6pujz5OccUaydn3CDKbHp/xMK6/ssT0ZK5idIr2NFu4abbL S9/NTft7LzIXys3cbfbdj1qatiSmRZnn5juRgGuw8ycA+TmaeEbzYiANA HGPBOFNqZUgi1mFtYTxBltuyX6Ore5n/1LTqfco+bCfH/Zf8egUu4QVoJ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="327779351" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="327779351" 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:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="675567039" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="675567039" 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:05 -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 07/20] soundwire: intel: add eml_lock in the interface for new platforms Date: Thu, 23 Mar 2023 13:44:39 +0800 Message-Id: <20230323054452.1543233-8-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 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