Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp165268ybi; Fri, 26 Jul 2019 07:47:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaDC3bGY8674AUFuHuGXDWpoXExRgC/PHeriG52p+gM0Gb1zYNFZhpruRse6p6IrQBJVoB X-Received: by 2002:a17:90a:376f:: with SMTP id u102mr99364852pjb.5.1564152476786; Fri, 26 Jul 2019 07:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564152476; cv=none; d=google.com; s=arc-20160816; b=j9SGGb1C+xfTNiBbjuOwPslUBEecySwQ4bHJRFnlLMbSL+/2jJjtMJixpcJCZaM3S5 m3fNBgZMPSZUQFFmEQDLIUUKyDomTaiooCbXhQjqEewGAbzW9NgDTA0nouiHL/uSJXpZ zWab3QgxIpN8Ue8lSaGe7UOf3KGSPtsfSCBCcIOnA42ims5qVFQ8uVKbfOdXAYquXZya WSYlbIViar5yCxsikJ6u01uAIOpBUfNM1LDj9uX/XQFBQEvrC+X3pBmE9Ic4xUHbUHah 7OyM5U/ybbb1ErypTJZ7sL70nyiCyJVrHKgbyWjVPTzA0D1tV6ZMRalMm+YnG/1oPJ/R Pvrg== 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=V6Yl+jnS7zX6BQUpmEW2wGEXOz7AKmmI7UWjzKNamfE=; b=ujechnZ8iimqkE82t5Ah4WGQq0UOZCtFIrGNQqWwP92IbWwvP8QaMnVz+iWPvPyxdt 5CLvruxjq8W+nWK/Dma40p0bGIlBu6tMg1C2lxfwnUOheuhzLJQ9zZ52rPxG1RAkYuh2 T2eGhCPeplJGjetVhw85QG8lkvUDZ+qIHd62eQpAb+vdejVtBNYPgTBjUMVZbR9mBHzv mfEbKvpNefv5WO3hnz4xOKHq0FqoYUvBg26I7fIdsTJmAamv+S7nYvIyuQsz3q6VbA9W tfdufpN2lGy0vvgtZWGSivNuR9NLq+/StNtZh001VYP/AM4kWEbbxeFJCxGMqi15RCSf z9Mw== 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 x4si21832897pjn.93.2019.07.26.07.47.41; Fri, 26 Jul 2019 07:47:56 -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 S2387477AbfGZOqg (ORCPT + 99 others); Fri, 26 Jul 2019 10:46:36 -0400 Received: from mga02.intel.com ([134.134.136.20]:39132 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728167AbfGZOqf (ORCPT ); Fri, 26 Jul 2019 10:46:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2019 07:46:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,311,1559545200"; d="scan'208";a="322056387" Received: from msmall-mobl.amr.corp.intel.com (HELO [10.251.154.62]) ([10.251.154.62]) by orsmga004.jf.intel.com with ESMTP; 26 Jul 2019 07:46:34 -0700 Subject: Re: [alsa-devel] [RFC PATCH 31/40] soundwire: intel: move shutdown() callback and don't export symbol To: Cezary Rojewski 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, 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> From: Pierre-Louis Bossart Message-ID: Date: Fri, 26 Jul 2019 09:46:34 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <39318aab-b1b4-2cce-c408-792a5cc343dd@intel.com> 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 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.