Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp8016058rwl; Thu, 23 Mar 2023 11:26:28 -0700 (PDT) X-Google-Smtp-Source: AKy350bk9k48baq/lDB+j2XydtVzhtCg6iUeOiH1SSPz8sWHnRVP1PqfhZh4F/o/I6g9ulKMH1pP X-Received: by 2002:aa7:d052:0:b0:4fb:999:e052 with SMTP id n18-20020aa7d052000000b004fb0999e052mr288773edo.33.1679595988015; Thu, 23 Mar 2023 11:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679595987; cv=none; d=google.com; s=arc-20160816; b=rgHSpOsLtqvoWfnmrQdy6PmFjvDsnEzl4ekzo72a5SBakzUeaWA+ua5BEld5hOhoR0 DloOHzEOdStCM60IADVBzXeAlAYMn+OtxqAGdSIU/LJJHamwrwgIvnF5YRcf6VbX6oG9 CQfdEA+SKAARXYu0Ele6Hrp91G3Xtd/uQW7CjG4Zu1gBsPUvWtvQlrLRKzXCE8/+NANm SlHjRlX30Ay/oAblhz/NohYKGahWYWtfv3f5aPzYIiDS1y1MMnvhpWpRH04UkvAYFVfa Mrez36xQ2AfXwF6nscIsGTJiiMG8J7GkEeemz324MsfyXfxXQ+wM2l0osx9UKyyBqhlC ZfGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Ld7Sec61hM9lLUF8De5SQvHHVs/20u1xG3j8A1obEzI=; b=fPV7D4NeklPB1v5B3QSQiQmnQTtGKTs33bExrVEysf7Lg5SSpnnY8yrfJzrfj/0GCV ZQRpRu1OnnUBWYqJZWUbWkVdlMKBTZHhzvJtnYv841LK9dOvdmI/oPpXNT/o+gCRWZ2z EUR5HjUKksxlt+RzzylC05c8WjqzcpIhCxbbG7cNo5O+CawrDRcFLVqSWqcn+qBNbl5/ 03OmQG/VIFLTw5YlS/O4KF4JHvrZcexalwgm/1HS3vyDnSCQk/TQYq8FPxO+TfJq5QpY Ey1O+FavxJGTSWfTOwjTcRnLxJLUs9aOkvtEfOsaCDudo8gzV8tj/FyjvZSBLsVwVR7X 9TAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f68jjA8w; 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 o10-20020a056402038a00b004aac683bad9si19934423edv.379.2023.03.23.11.26.03; Thu, 23 Mar 2023 11:26:27 -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=f68jjA8w; 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 S231225AbjCWSLP (ORCPT + 99 others); Thu, 23 Mar 2023 14:11:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbjCWSLN (ORCPT ); Thu, 23 Mar 2023 14:11:13 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48A5AA270 for ; Thu, 23 Mar 2023 11:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679595073; x=1711131073; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=rUn3oqJLeZ+PcZAIu66R71ASeFhwezXaOFWYnk+LTbQ=; b=f68jjA8wOk+7OJiYpzO32CmnDy55jT//pz/LnE/WWpnmzVyaCJ+6BEIx oLQwmXSRgR76tLHDkioD6RvEjik+o0cWOSRAXlShvTOaJdiFBwvMnflhR Qf5ikxxHLFoMqDm0bOlRGNg7FO62l/LO6I4CH0R0t0O9YUt9qCoptygAr 9EHF2wiWEDb06Iaq3yq5SiF8feACfF/42kqyVKr2nJsdZ7mcSWPpG6kMc gfN/1i5Mu+cqYv3TRblxtPo/sz76zOsTnVhXwL0K5eiq3QxabcXi/lGdI TKSWQI2rpmCr7aBY0XoCjb6M3hY1tGIzvzjrpadPhQALM1rvSC5bzVt75 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="319239497" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="319239497" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 11:11:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="682390296" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="682390296" Received: from dsamoylo-mobl.amr.corp.intel.com (HELO [10.209.65.26]) ([10.209.65.26]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 11:11:12 -0700 Message-ID: <5dc11c47-bae6-2f4e-4ffd-58c4f462fd68@linux.intel.com> Date: Thu, 23 Mar 2023 13:11:11 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.8.0 Subject: Re: [PATCH 3/4] ASoC: codecs: wsa883x: mute/unmute PA in correct sequence Content-Language: en-US To: Mark Brown , Srinivas Kandagatla Cc: tiwai@suse.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, johan+linaro@kernel.org, steev@kali.org, dmitry.baryshkov@linaro.org References: <20230323164403.6654-1-srinivas.kandagatla@linaro.org> <20230323164403.6654-4-srinivas.kandagatla@linaro.org> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, 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 >> +static int wsa883x_trigger(struct snd_pcm_substream *s, int cmd, >> + struct snd_soc_dai *dai) >> +{ >> + switch (cmd) { >> + case SNDRV_PCM_TRIGGER_START: >> + case SNDRV_PCM_TRIGGER_RESUME: >> + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: >> + wsa883x_digital_mute(dai, false, 0); >> + break; > >> static const struct snd_soc_dai_ops wsa883x_dai_ops = { >> + .startup = wsa883x_startup, >> .hw_params = wsa883x_hw_params, >> .hw_free = wsa883x_hw_free, >> - .mute_stream = wsa883x_digital_mute, >> + .trigger = wsa883x_trigger, > > The trigger is run in atomic context, can you really write safely to a > SoundWire device there? Mark, I've seen that comment from you several times, and I wonder if I am missing something: the triggers for SoundWire managers and dailinks are typically nonatomic - at least for the Cadence-based solution the trigger is based on a bank switch that may happen with a delay and with a wait_for_completion(). Sending a command over the SoundWire channel is also typically not atomic, there's usually a wait_for_completion() as well.