Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1898739pxb; Mon, 13 Sep 2021 07:46:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbop1Ldn5UNWZK98suSVqrGo8+/3EQpKRJiBamQ2dh9nluPC4bUOJIqXQqMpaL+CDNetOz X-Received: by 2002:a05:6638:2493:: with SMTP id x19mr10168746jat.57.1631544400023; Mon, 13 Sep 2021 07:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631544400; cv=none; d=google.com; s=arc-20160816; b=e5DTy9hP2WuBFBR/n7nhq0W8wPuH4zD4gdHtkvnhD+pcZnUbSsElfOcnmESf4MJZDT r3U+x2Fk2XFalVlZVhVxMvMNJz8o9usI8OYky4u0oTeLg/YCX/71UIiqrzFhO9uzLIhQ PZycDeHqOJyZULkyjb7/X/r4UYXKaSFygkws8barJ99eTVZ1XMvaHU6s172qykCdxuJG 7Kj9AUQ0RX8AG5RYRTeGN/B0f2wtV55s1D6cTx+OoM8sHiS58pqG4uRvpvwp1fs9hwDk /torTBIW6aBcLyOabhyeBs7JCYVRCbHEMTCVqvyaudBIDEDrJUKA+oZYXeOIqF0t3+Ea 3Rfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fPJsVUTFRGUUUc8e8S5QuwxifGfvc7XGC/bZcSHn9zM=; b=ZyfvJj7ueNi2zaJvUoTA76XDPvn6iYe75SknMzYKwlHY1CoDVP5nN6Hk0dTdlTcXv+ 8Q/kgbH/TprIUO0m4HrPN/jzPrUtWfIJ8nVtxRsaL7S3WxQ4ZLeaiAbaih3BMmYpNGMb xvCXu3Zv7K7fAv3M/UaSpWoj6bhBbdF/BIHsjhgLWozeiP27yKSrxN+JnWoV93wE4Xyy pQ7ExdroEtDjk7g2fwTQXPkbq4ctCjIMxbAobZTAHdG7fh+AhXlZUAGiHNVwZbpNVD+h hVGyU640QZHywwBWuoX3RC0zxZSn6WaYpY426TWlTJ3epJxrCnRa1sTfXxutStqH+JRy 3H2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gq5taA2c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si2383645ioh.97.2021.09.13.07.46.28; Mon, 13 Sep 2021 07:46:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gq5taA2c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348041AbhIMOor (ORCPT + 99 others); Mon, 13 Sep 2021 10:44:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:55842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346533AbhIMOjT (ORCPT ); Mon, 13 Sep 2021 10:39:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DC116113E; Mon, 13 Sep 2021 13:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541324; bh=gTZ+FGzDPLRC11wr1V9rfXhxQuTN4Zfm2wOT3/awIoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gq5taA2cjsTHVq0238oAOmZMxp+EYGXlUsF0khHzsjYceoVX3LHmiX3gKnEsizcJl FMy+qNDc66spqYIOMB6A5I56iuKnW1u4aE4pbWbSUOkJJEcmrAK1ah/PajhGgWHD+9 0hSqe882vgEb7RObtZ5fc7HBVs2HKgMEsbGLBIa4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.14 253/334] ASoC: wm_adsp: Put debugfs_remove_recursive back in Date: Mon, 13 Sep 2021 15:15:07 +0200 Message-Id: <20210913131121.960933717@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Charles Keepax [ Upstream commit e6d0b92ac00b53121a35b2a1ce8d393dc9179fdf ] This patch reverts commit acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs"), and adds an alternate solution to the issue. That patch removes the call to debugfs_remove_recursive, which cleans up the DSPs debugfs. The intention was to avoid an unbinding issue on an out of tree driver/platform. The issue with the patch is it means the driver no longer cleans up its own debugfs, instead relying on ASoC to remove recurive on the parent debugfs node. This is conceptually rather unclean, but also it would prevent DSPs being added/removed independently of ASoC and soon we are going to be upstreaming some non-audio parts with these DSPs, which will require this. Finally, it seems the issue on the platform is a result of the wm_adsp2_cleanup_debugfs getting called twice. This is very likely a problem on the platform side and will be resolved there. But in the mean time make the code a little more robust to such issues, and again conceptually a bit nicer, but clearing the debugfs_root variable in the DSP structure when the debugfs is removed. Fixes: acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs" Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20210824101552.1119-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm_adsp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index fe15cbc7bcaf..a4d4cbf716a1 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -747,6 +747,8 @@ static void wm_adsp2_init_debugfs(struct wm_adsp *dsp, static void wm_adsp2_cleanup_debugfs(struct wm_adsp *dsp) { wm_adsp_debugfs_clear(dsp); + debugfs_remove_recursive(dsp->debugfs_root); + dsp->debugfs_root = NULL; } #else static inline void wm_adsp2_init_debugfs(struct wm_adsp *dsp, -- 2.30.2