Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2550555ybh; Mon, 5 Aug 2019 02:56:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEM+KoTpvlEOWJOOCWp/Ep2pKueV54vH31CTxeIdfsdgY+GreEDMZrWXfy3O2g/8s4BPcM X-Received: by 2002:a63:1d2:: with SMTP id 201mr102629484pgb.307.1564999011354; Mon, 05 Aug 2019 02:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564999011; cv=none; d=google.com; s=arc-20160816; b=prgec5z6zLIMe9zIlZ5zd85FeOsRf0Dfxl39bhpXEDlUDUI9EAhxc91uC9HWNDhU92 LXvHny4yf7Ingy4jYAIkAb7PP1bI9TR5pP3h9p3ZybDKVEHJ3bsKlhNCITG2I7lKoklK RuxWkJXju4f8TaQr9vaidSEp046fedY7+xP1Hqxa5SSw4AW9dbACTnZvM5ZZL5Hhi9i+ i9483mKi9BNFAg6VnqQ1I5TvIYVN/x2gaP93WisXYjNujXcATqTPg34eQpEBY0XX/QHn LmE8GiJhquST2rXrYp5myDvZ3gIPBim5z1+RjrS4GOiAu9KjqHU8uXGVuWv1/D0e+fg4 zWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FpUKepzkM90e94EJ8And9QiwgLAMopyjZxR+SWOqofg=; b=lNYS9nxD7sDSlNTS0hoGyT3z8PtYUQRraLP1Yzr4BuKwauPoQcvhjnGajhD6z3ypPS gzBvE/VmwDGwlETGOaUwI1YXS4B/oDlCo6yHbxW+8VGk7HrcPxB2NPoAM42jPD8LfB0o dxc836SR7gNTZ/Du3JPpztVWNRO31xtjM5d52frkvG6lkp3/qG9rPhe0GxIXgKH1Z/M5 UFliD3D+QkJcnJWR1XXXaE9o3I5JQlWWojmKtNhwG2WawePSHxEy0JogKPAEdUvTHlhR zCjRkjbyUNuWIZvTXTUJGgWNIPJb+HVKX6bFQSZhF4U5xUF4glB/Bq0nmIA8bjYGYORC iXkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si11970945pjo.102.2019.08.05.02.56.35; Mon, 05 Aug 2019 02:56:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728182AbfHEJyd (ORCPT + 99 others); Mon, 5 Aug 2019 05:54:33 -0400 Received: from mga04.intel.com ([192.55.52.120]:20851 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbfHEJyc (ORCPT ); Mon, 5 Aug 2019 05:54:32 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 02:54:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,349,1559545200"; d="scan'208";a="349059850" Received: from buildpc-hp-z230.iind.intel.com (HELO buildpc-HP-Z230) ([10.223.89.34]) by orsmga005.jf.intel.com with ESMTP; 05 Aug 2019 02:54:28 -0700 Date: Mon, 5 Aug 2019 15:26:20 +0530 From: Sanyog Kale To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com Subject: Re: [RFC PATCH 23/40] soundwire: stream: fix disable sequence Message-ID: <20190805095620.GD22437@buildpc-HP-Z230> References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-24-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190725234032.21152-24-pierre-louis.bossart@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 06:40:15PM -0500, Pierre-Louis Bossart wrote: > When we disable the stream and then call hw_free, two bank switches > will be handled and as a result we re-enable the stream on hw_free. > I didnt quite get why there will be two bank switches as part of disable flow which leads to enabling of stream? > Make sure the stream is disabled on both banks. > > TODO: we need to completely revisit all this and make sure we have a > mirroring mechanism between current and alternate banks. > > Signed-off-by: Pierre-Louis Bossart > --- > drivers/soundwire/stream.c | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > > diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c > index 53f5e790fcd7..75b9ad1fb1a6 100644 > --- a/drivers/soundwire/stream.c > +++ b/drivers/soundwire/stream.c > @@ -1637,7 +1637,24 @@ static int _sdw_disable_stream(struct sdw_stream_runtime *stream) > } > } > > - return do_bank_switch(stream); > + ret = do_bank_switch(stream); > + if (ret < 0) { > + dev_err(bus->dev, "Bank switch failed: %d\n", ret); > + return ret; > + } > + > + /* make sure alternate bank (previous current) is also disabled */ > + list_for_each_entry(m_rt, &stream->master_list, stream_node) { > + bus = m_rt->bus; > + /* Disable port(s) */ > + ret = sdw_enable_disable_ports(m_rt, false); > + if (ret < 0) { > + dev_err(bus->dev, "Disable port(s) failed: %d\n", ret); > + return ret; > + } > + } > + > + return 0; > } > > /** > -- > 2.20.1 > --