Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp783080ybh; Sat, 3 Aug 2019 09:41:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbvv/P5TjGEF4hxj4Ivo2h50b6N9vJ0VdzbME6bQ6+jzKkLedeGokuDTY52OK/67qOhdce X-Received: by 2002:a17:90b:28f:: with SMTP id az15mr9912549pjb.18.1564850488085; Sat, 03 Aug 2019 09:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564850488; cv=none; d=google.com; s=arc-20160816; b=OaDf3MVAHml+bKN2MgQosMPvJoZyDR6WsDE27wb8UvMXghCXctKJRqR3tU6nRzO+gS IfsMv+Bmi0YD2JstJTEM/4qQz3Nezwd00a/8b9bjbnTv7+o5A1/XNiw6WerE+i3Go0mA LeAs40wzewh4UQL4tbSUq7+rvZXEEMUsz+vKtWtpuHTX6Lq7HPUX7EC3V3rHVwA0uTwh 5Rxlr8+TsGKSRxdwUg23nsFQMTCqS9AEBjPHFwhu9CrBlouaotwnOHvYlY76o9Jtwjpf sm3ToaG50uwlKTi3RjijLw0TuT0jYXwSUqiecpajv4XB9xxbBFIsatn+3KhUXA5JJIDG UaQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=h0ZifQNOgiPoGBEdlPiZszE6/de6yf2aGocf9YEWE/k=; b=LAQZMKgAbzrtU1tWvgwkxhYth0Qi8ioQgw7/CV+h6lShmnQlVomhmG8v69NL6g/Twb QcvjLiCwlT+OAFmlCquw3LEpRE5jVaObyMiJoXuSp9uWuWBBiv+z2CnsQ1EIJF7aqBCS uVcVHvWsmzfq58M1BYDkGNYgb39A4t5cGQCAa1Wh4n+hEWOCQB3Zam32ZqdeffQv5fGp g/fUe4GVxvBX4PgyKaLRdG78jsBJH5yUwkgVwjAUnFqeQ8h2A98H+mopoZREj1xku+ee i+7qAjmq95pzVLpTOAsvkCeauZJHN2TsloIqofqBe20Wo/DR84GfxCDpPL3gEYmfyk8c rL1w== 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 l10si44077242pgp.411.2019.08.03.09.41.13; Sat, 03 Aug 2019 09:41:28 -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 S2405970AbfHBRmf (ORCPT + 99 others); Fri, 2 Aug 2019 13:42:35 -0400 Received: from mga12.intel.com ([192.55.52.136]:23521 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405700AbfHBRmc (ORCPT ); Fri, 2 Aug 2019 13:42:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 10:42:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,339,1559545200"; d="scan'208";a="181076587" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 02 Aug 2019 10:42:31 -0700 Received: from cwhanson-mobl.amr.corp.intel.com (unknown [10.252.133.191]) by linux.intel.com (Postfix) with ESMTP id 852B958046F; Fri, 2 Aug 2019 10:42:30 -0700 (PDT) Subject: Re: [alsa-devel] [RFC PATCH 31/40] soundwire: intel: move shutdown() callback and don't export symbol To: Vinod Koul Cc: Cezary Rojewski , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-32-pierre-louis.bossart@linux.intel.com> <39318aab-b1b4-2cce-c408-792a5cc343dd@intel.com> <20190802172843.GC12733@vkoul-mobl.Dlink> From: Pierre-Louis Bossart Message-ID: Date: Fri, 2 Aug 2019 12:42:29 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190802172843.GC12733@vkoul-mobl.Dlink> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/19 12:28 PM, Vinod Koul wrote: > On 26-07-19, 09:46, Pierre-Louis Bossart wrote: >> >> >> On 7/26/19 5:38 AM, Cezary Rojewski wrote: >>> On 2019-07-26 01:40, Pierre-Louis Bossart wrote: >>>> +void intel_shutdown(struct snd_pcm_substream *substream, >>>> +            struct snd_soc_dai *dai) >>>> +{ >>>> +    struct sdw_cdns_dma_data *dma; >>>> + >>>> +    dma = snd_soc_dai_get_dma_data(dai, substream); >>>> +    if (!dma) >>>> +        return; >>>> + >>>> +    snd_soc_dai_set_dma_data(dai, substream, NULL); >>>> +    kfree(dma); >>>> +} >>> >>> Correct me if I'm wrong, but do we really need to _get_dma_ here? >>> _set_dma_ seems bulletproof, same for kfree. >> >> I must admit I have no idea why we have a reference to DMAs here, this looks >> like an abuse to store a dai-specific context, and the initial test looks >> like copy-paste to detect invalid configs, as done in other callbacks. Vinod >> and Sanyog might have more history than me here. > > I dont see snd_soc_dai_set_dma_data() call for > sdw_cdns_dma_data so somthing is missing (at least in upstream code) > > IIRC we should have a snd_soc_dai_set_dma_data() in alloc or some > initialization routine and we free it here.. Sanyog? the code does a bunch of get_dma_data() and this seems to work, but indeed I don't see where the _set_dma_data() is done. magic.