Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp415976ybi; Wed, 19 Jun 2019 01:35:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWtHGS9MWcsbYu+L4FIYVxYxQXjUPtcjwU16o6DVxNLZeFzmO/ltT+M77Fv5V4EHAtlkSL X-Received: by 2002:a62:754d:: with SMTP id q74mr99691879pfc.211.1560933337023; Wed, 19 Jun 2019 01:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560933337; cv=none; d=google.com; s=arc-20160816; b=Y6qpSnYTxvAtJejOISLh/wFfOoRYQcvvn7bifhmjFdwOdyvyHplig6tVh68RoPl6hl psRxunTI+SM9kJiWhYMZEAaZDEcnRWpHm6A3l8kshaBILm6/lF3MvGASm0QIoIZe+3UW aV3BxFMQiFPnZf0SrYKevTld/yIxcUpIgYTsNlup8Jjof0tBnuCOVAJVccmV1Vg9adf3 Cc/EdxPaS5LT+cyslZlnGiYNlyOmEImaVhqMQ+kOPpChqbhj3Y7mTL3Z8a/2MlictIKL 8/DqOBPAzIxeUt0W9Nj/cnyld1ZGY9xYnfmxZWGyUSCJWs5r4Z5YWQhFK7lguoF7YgP0 JOWg== 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:message-id:subject:cc:to:from:date; bh=gjk77ecOIThBrUmYz3G3AnUPZ6vd4mD5j1FNOE46deQ=; b=G+8TZE/H5U7OKLgpAdl7jM59EI+KSx4Oh1TwZMsLx67WZlEGqbbxWLlFYHJrZUXnXM IHR57NU49+sP1AV1Zkqq3MPopnoQjAyWWZJlA6Yk6FJhQ2zEp9C8/tVbvA/ahMXXFuqv BhF0rHz3cyAyKYhtKooX2LTKo9nMzQH8VYokMf8xH6WqAJEJ1pheaYo4pURHMXMMX2KS hC1jXNLIWVwrBRVbI3UfbLp86jaq+AXrjPP30VXrstpQ5XwjIuaqh2PG4O7pHdbU40NE 2zD+8oQHVqYcNaUQsjnWL6u1wsjWeQUy+pA9Sq0NLLKZuFNbGHBO0GW8y7+ADzHeDGmj uzrA== 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 gn22si15090871plb.422.2019.06.19.01.35.21; Wed, 19 Jun 2019 01:35:37 -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 S1731239AbfFSIfK convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Jun 2019 04:35:10 -0400 Received: from mga04.intel.com ([192.55.52.120]:58054 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730783AbfFSIfK (ORCPT ); Wed, 19 Jun 2019 04:35:10 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 01:35:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="162147085" Received: from xxx.igk.intel.com (HELO xxx) ([10.237.93.170]) by orsmga003.jf.intel.com with ESMTP; 19 Jun 2019 01:35:05 -0700 Date: Wed, 19 Jun 2019 10:38:59 +0200 From: Amadeusz =?UTF-8?B?U8WCYXdpxYRza2k=?= To: Ranjani Sridharan Cc: alsa-devel@alsa-project.org, Liam Girdwood , linux-kernel@vger.kernel.org, Cezary Rojewski , Jie Yang , Pierre-Louis Bossart , Takashi Iwai , Mark Brown Subject: Re: [alsa-devel] [PATCH v2 09/11] ASoC: Intel: hdac_hdmi: Set ops to NULL on remove Message-ID: <20190619103859.15bf51c5@xxx> In-Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. snd_soc_sst_bxt_rt298 40960 0 snd_soc_hdac_hdmi 45056 1 snd_soc_sst_bxt_rt298 snd_soc_dmic 16384 1 snd_soc_rt298 65536 2 snd_soc_sst_bxt_rt298 snd_soc_rt286 61440 0 snd_soc_rl6347a 16384 2 snd_soc_rt298,snd_soc_rt286 snd_soc_skl 372736 0 snd_soc_sst_ipc 20480 1 snd_soc_skl snd_soc_sst_dsp 36864 1 snd_soc_skl snd_hda_ext_core 28672 2 snd_soc_hdac_hdmi,snd_soc_skl snd_hda_core 139264 3 snd_hda_ext_core,snd_soc_hdac_hdmi,snd_soc_skl snd_soc_acpi_intel_match 53248 1 snd_soc_skl snd_soc_acpi 16384 2 snd_soc_acpi_intel_match,snd_soc_skl snd_soc_core 405504 6 snd_soc_rt298,snd_soc_rt286,snd_soc_hdac_hdmi,snd_soc_skl,snd_soc_dmic,snd_soc_sst_bxt_rt298 snd_compress 36864 2 snd_soc_core,snd_soc_skl snd_pcm_dmaengine 16384 1 snd_soc_core snd_pcm 163840 10 snd_soc_rt298,snd_soc_rt286,snd_hda_ext_core,snd_soc_hdac_hdmi,snd_compress,snd_soc_core,snd_soc_skl,snd_hda_core,snd_soc_sst_bxt_rt298,snd_pcm_dmaengine snd_timer 53248 1 snd_pcm Amadeusz