Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3290253ybi; Mon, 17 Jun 2019 21:19:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOY2gOW47IwfqI+Z6UU4UUKOObq2tAQigsTYdPK072sqxNqoJ+Y+yU5J2ARXXjUwVJvBqk X-Received: by 2002:a17:90a:ad93:: with SMTP id s19mr2881411pjq.36.1560831577864; Mon, 17 Jun 2019 21:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560831577; cv=none; d=google.com; s=arc-20160816; b=eGq4QQ91jFMoyV1MG6sBJVA/eN5+qe6i+CR09oFlY6qjAKAHnl+PEAA74nnphzo1rX Lg7zu91Y+EWB7qqT1cpOJ4jwMpto4VN6ejvjr6r3ZYKOo59LSL/odHQ2QpyXfgQ6JzOg lEseMOiZ54WRXkjo+ZYcY1MEqR7pOyqXeZwtp2mr/UjSnRPLKSoOk2B3nBhdBiXu+3Mg EQmWFwC4HMIKvMrPpYPd6KcYpnBo+8y7j+xBx+OFM40dyJ5UXt7belFc8WI8SjIWOB1+ Qe+X+cGMdQHlG3TCX85e0skogSsp7kQm601xdp0BTuLlN+gsb+nXbjqbIkP79Q6GJukC +fkw== 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=rpfNiil8UvBjRkDNyHj3/pBpX30fbedELAsYXAbWBQw=; b=dNppw8BQoQjkH1y5+yibHoQgkSA6Fnte/x8z+tWsSzkTjxcprL9ocTgzlDZ2QTOJ+e FyQCLllGJUWgfHjr3S9Nxnc6v9/qs+lb/nYVQSWphB/hTq74+6EniAmrLlaAiy8iEfoM wgBsgHEKGpXEAxQ9DdBoHWUOmciUMHIcup6zb0S6YeJ0PWdCJhLLfAEhH3tQxcrBhG5O zYohqNYwmN6L7UffMc+n0GNM1En5E80fmeN88PGCq+xMJsRIyKmT38DqAG6kHLVsHwJW asMKVqEaf9HfQx+dk2jiNH+V/DGJBCyMY2eYyoJce3F3YDAyjuuqCtA0xu5IYet/U6Ty J57g== 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 b5si1165301pjo.26.2019.06.17.21.19.21; Mon, 17 Jun 2019 21:19: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 S1726233AbfFRETR (ORCPT + 99 others); Tue, 18 Jun 2019 00:19:17 -0400 Received: from mga17.intel.com ([192.55.52.151]:42165 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbfFRETQ (ORCPT ); Tue, 18 Jun 2019 00:19:16 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 21:19:16 -0700 X-ExtLoop1: 1 Received: from rmbutler-mobl.amr.corp.intel.com ([10.255.231.126]) by fmsmga004.fm.intel.com with ESMTP; 17 Jun 2019 21:19:15 -0700 Message-ID: <1fd4af8e1b4bad5eda6f1e2f747b7988c74408fb.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: Takashi Iwai Cc: alsa-devel@alsa-project.org, "\"Amadeusz" =?UTF-8?Q?S=C5=82awi=C5=84ski=22?= , Liam Girdwood , Cezary Rojewski , Mark Brown , Pierre-Louis Bossart , Jie Yang , linux-kernel@vger.kernel.org Date: Mon, 17 Jun 2019 21:19:15 -0700 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> 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 Mon, 2019-06-17 at 23:36 +0200, Takashi Iwai wrote: > On Mon, 17 Jun 2019 22:51:42 +0200, > 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(). > > It's a different one. The codec driver registers / de-registers the > notifier at its probe/remove, while the controller driver takes care > of snd_hdac_acomp_init(). snd_hdac_acomp_exit() is usually not > needed > to be called explicitly, as it's managed via devres. Makes sense, thanks Takashi. But I am still wondering why we havent seen this issue with SOF yet. We run the module unload/reload stress test as well and havent seen this yet. Thanks, Ranjani > > > Takashi > > > 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? > > > > Thanks, > > Ranjani > > > > > > Signed-off-by: Amadeusz Sławiński < > > > amadeuszx.slawinski@linux.intel.com> > > > --- > > > sound/soc/codecs/hdac_hdmi.c | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/sound/soc/codecs/hdac_hdmi.c > > > b/sound/soc/codecs/hdac_hdmi.c > > > index 911bb6e2a1ac..9ee1bff548d8 100644 > > > --- a/sound/soc/codecs/hdac_hdmi.c > > > +++ b/sound/soc/codecs/hdac_hdmi.c > > > @@ -1890,6 +1890,12 @@ static void hdmi_codec_remove(struct > > > snd_soc_component *component) > > > { > > > struct hdac_hdmi_priv *hdmi = > > > snd_soc_component_get_drvdata(component); > > > struct hdac_device *hdev = hdmi->hdev; > > > + int ret; > > > + > > > + ret = snd_hdac_acomp_register_notifier(hdev->bus, NULL); > > > + if (ret < 0) > > > + dev_err(&hdev->dev, "notifier unregister failed: err: > > > %d\n", > > > + ret); > > > > > > pm_runtime_disable(&hdev->dev); > > > } > > > >