Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1131319ybi; Wed, 19 Jun 2019 14:11:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXL3oe0LF8tPzpfsVQ04Z9yCHYpSAh09iukAVkcvNeRZayn7EPjRhxUtldp9VmkZK3wR6Q X-Received: by 2002:a63:5a02:: with SMTP id o2mr9208666pgb.93.1560978670079; Wed, 19 Jun 2019 14:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560978670; cv=none; d=google.com; s=arc-20160816; b=ZSa1+PkwCHLDxNgFC1mjf19TulUiKQYXkgBvDAIjIRm4kyukE6wgy9dZpi1QD9Rmyk PIFZq5vXVUid8yTTlipCWmVblwgf0PVM9GuFZzUZlpMjIilbCShzLWDsOkREqwOB/cBT 7PFn3NRjRmeNUiax3mLXin36dNY/fgpD8ADxjTmTW48TC3k3/Y8uRR9zt8L7W+W7oPdh qBLJIZPqkbI5RMSCm3o4hcgzC/04/V1h92nB/DGuv+zoW5iQIHdgKqTY+2WXY4GuUywR o5al1GHXoAMhvhsMvYNWiKOf2UFVeWdI0ayu378UvKWRX1w20ldGtB4WjJd2LmY5gePw 5Ddg== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=OlSSrD9MEcikQ7hkz2/qMo3+P5ljx+KZCVp8OA2/Qng=; b=TOCIW9cde0UdJ4DnP3nVTajSrjIgpyAjOz1zB/z8NG3hN6rbFUzesLjGfA0uj5cvSy BSB8HHQytzood0GNCQXaMCwB+7YDz9sHl9RHrwO3Gkwus/6zeybhcUk2gbmWbBm2Cxhz 1SuJNaTgilqvJbWoSjnynokDXk/1xuWjaUp/g9ZwL7ghFQzHOuH9zYToLgyxlOXugVZe 2dfvbnv0lLaM36ex+fhI5PaQMLqFR/FUI/P2L2OY511p1865ApRfNP3tuYa9yZl1Dl7K o+mRShMKPp8OODyWBIQ0cLbZIq/yPAVOom5yPPX1ITjA/XSQWDWMQ0Se9yxy2viYNQwl 4FoA== 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 p23si3936023pgj.356.2019.06.19.14.10.54; Wed, 19 Jun 2019 14:11:10 -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 S1730074AbfFSVJY (ORCPT + 99 others); Wed, 19 Jun 2019 17:09:24 -0400 Received: from mga02.intel.com ([134.134.136.20]:60631 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfFSVJY (ORCPT ); Wed, 19 Jun 2019 17:09:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 14:09:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,394,1557212400"; d="scan'208";a="243428686" Received: from nmendi-mobl.amr.corp.intel.com ([10.251.150.122]) by orsmga001.jf.intel.com with ESMTP; 19 Jun 2019 14:09:22 -0700 Message-ID: <0c939329d17c50c353acacf164583ba259a775c0.camel@linux.intel.com> Subject: Re: [alsa-devel] [PATCH v2 09/11] ASoC: Intel: hdac_hdmi: Set ops to NULL on remove From: Ranjani Sridharan To: Amadeusz =?UTF-8?Q?S=C5=82awi=C5=84ski?= Cc: Cezary Rojewski , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Jie Yang , Pierre-Louis Bossart , Liam Girdwood , Mark Brown Date: Wed, 19 Jun 2019 14:09:22 -0700 In-Reply-To: <20190619103859.15bf51c5@xxx> References: <20190617113644.25621-1-amadeuszx.slawinski@linux.intel.com> <20190617113644.25621-10-amadeuszx.slawinski@linux.intel.com> <75be86354032f4886cbaf7d430de2aa89eaab573.camel@linux.intel.com> <20190618130015.0fc388b4@xxx> <20190619103859.15bf51c5@xxx> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-06-19 at 10:38 +0200, Amadeusz Sławiński wrote: > On Tue, 18 Jun 2019 08:58:22 -0700 > Ranjani Sridharan wrote: > > > On Tue, 2019-06-18 at 13:00 +0200, Amadeusz Sławiński wrote: > > > On Mon, 17 Jun 2019 13:51:42 -0700 > > > Ranjani Sridharan wrote: > > > > > > > On Mon, 2019-06-17 at 13:36 +0200, Amadeusz Sławiński wrote: > > > > > When we unload Skylake driver we may end up calling > > > > > hdac_component_master_unbind(), it uses acomp->audio_ops, > > > > > which > > > > > we > > > > > set > > > > > in hdmi_codec_probe(), so we need to set it to NULL in > > > > > hdmi_codec_remove(), > > > > > otherwise we will dereference no longer existing pointer. > > > > > > > > Hi Amadeusz, > > > > > > > > It looks like the audio_ops should be deleted > > > > snd_hdac_acomp_exit(). > > > > Also, this doesnt seem to be the case with when the SOF driver > > > > is > > > > removed. > > > > Could you please give a bit more context on what error you see > > > > when this happens? > > > > > > Hi, > > > > > > I get Oops. This is what happens with all other patches in this > > > series and only this one reverted: > > > > > > root@APL:~# rmmod snd_soc_sst_bxt_rt298 > > > root@APL:~# rmmod snd_soc_hdac_hdmi > > > root@APL:~# rmmod snd_soc_skl > > > > Thanks, Amadeusz. I think the order in which the drivers are > > removed > > is what's causing the oops in your case. With SOF, the order we > > remove is > > > > 1. rmmod sof_pci_dev > > 2. rmmod snd_soc_sst_bxt_rt298 > > 3. rmmod snd_soc_hdac_hdmi > > > > Well, there is nothing enforcing the order in which modules can be > unloaded (and I see no reason to force it), as you can see from > following excerpt, you can either start unloading from > snd_soc_sst_bxt_rt298 or snd_soc_skl, and yes if you start from > snd_soc_skl, there is no problem. > I am good with this patch. I just wanted to understand why we werent seeing this error with SOF. Sure, there's nothing enforcing the order in which modules are unloaded but there must be a logical order for testing purposes. Pierre, can you please comment on it. I vaguely remember discussing this with you last year. Thanks, Ranjani