Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2055791lqb; Mon, 27 May 2024 06:36:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWhBZ12PuLmEBwrINkmNSbSe4511jmz9d6WJE1vv3hL6m3LP1s5pAtpvufZBS50IKksHuABV6EqDu20L63BWIc85OKNYnH/W8fXi9dRNg== X-Google-Smtp-Source: AGHT+IFOrxEWPpSfeHR2Dn9wO0xI1OvaWWoPsc8ZbZwEQElZAPE4vnSrsuYPpqnQqS9BNmLhNsJ7 X-Received: by 2002:a05:6870:a549:b0:24f:d9d1:6274 with SMTP id 586e51a60fabf-24fd9d24ff5mr5937979fac.23.1716817008233; Mon, 27 May 2024 06:36:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716817008; cv=pass; d=google.com; s=arc-20160816; b=b5/S1uN2ny2QLdyn/2h0W+soeZd3RAfWhkEU0Nhf4VFVVAIULsVhkLy/iaTPrYlbcX /gmk1dubhoFK4qmPTVVZJXMkiDP+2cEDzFMRP8Bi96mKUOvl4NFv9OATsfc/XAMTb6Oq SYwQ2Qrd5Tx0FqsJl+0ZCoB1DoHj5oM8nyVxFSDwhDSk2jmMvHoFqgFOA+wIzrxRWxUw L+HOdDaPSHBVyrI/QbZJEg8Glle4QJyd15w5WVPb67H/MQxHyl3b7y9yjzEL2ufAy1hS QtRtYxPVf27DxtAvLvt8gzCGIib2ZH3hBmfatcoCIhHZiqzgGZAtqT6U3cHHARKdwC7b fUzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=KjU72H2UeSER9dOoVfzNtEVBTPrXZ2w+pmd4Ar3/bEI=; fh=nVSrgl35C0UVW0TlbdsdioLn87SRWj5OV3ZZdH2MvwM=; b=hS8UpEIzT3wTKKs8JiqsSI1vqalyPoNLRmEY7UCt+at1qCJuON6sTPNLxG7H3JB4Qs sxOVF4fPZahQ1SBOKRpOf33ucFI9bLcuJEgyUtPdOyiO/RNXlU4LR/D/pbT8bEVMwWiZ TBlFI1rB6RvklapMGRlbj3ccXc6q6Quw308G7WAZ5aPBrJojauzcTRiFEPmYmJbPzEl4 n3jc/rN8YwDWKu5I0RnttI5z6QLoGw8AdOc4xC3J3QAXNt7BlW3+yrup7Mm/+xJ/eYA6 889i0Hqr+TN9RhfpqtUvi3OmyWdsGEO2CQeYEX5Ns3mpITuO8gfkcktGDLqiid1SOClk mMdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gpxsee.org); spf=pass (google.com: domain of linux-kernel+bounces-190723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190723-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ad75663373si44271826d6.506.2024.05.27.06.36.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 06:36:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gpxsee.org); spf=pass (google.com: domain of linux-kernel+bounces-190723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190723-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EDAF21C21493 for ; Mon, 27 May 2024 13:36:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D45516079A; Mon, 27 May 2024 13:33:16 +0000 (UTC) Received: from mx.gpxsee.org (mx.gpxsee.org [37.205.14.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B00FF15FD17; Mon, 27 May 2024 13:33:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.205.14.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716816795; cv=none; b=qn8hbPTxf3WId6oMfk6SrrRc6+CQkdYpnso+evFo7ruib+b2pbvpbOjqdpmvFUvKUkLvW54s1byC/1k6NcU4o2YXaxatzJ9BII9JW4hYJYCcOLU9rqNB+lOV7j+Rkk9at91Tg59cmaj5epqLOZ5h+qhYhDJj0Qi39Q2c/+YEbQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716816795; c=relaxed/simple; bh=N9Z9g74Cf30Clzkg1dZLVo8PczdHtxPMh0Nb4/3A6fI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ivf9z8wsE/ijkNXAw17Ueu3Gr4k4CwzudBrNYopmVQjzTe50KLIdYgm6iOJyXvvc8k3g2qmMyJZodJVCHbDyKnJ3rzie/LsFWU5m9o41KwbcEuMOwIuCoOVdArlTzemAQvbevoFYFEllSPWZhHm4yZHsnBWwTd+3TINk1qI7PCA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gpxsee.org; spf=pass smtp.mailfrom=gpxsee.org; arc=none smtp.client-ip=37.205.14.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gpxsee.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gpxsee.org Received: from [192.168.42.135] (unknown [85.193.2.91]) by mx.gpxsee.org (Postfix) with ESMTPSA id 59D0330BBB; Mon, 27 May 2024 15:33:05 +0200 (CEST) Message-ID: <2366ed1f-c6e0-40ce-90f3-e1a4b2d264bb@gpxsee.org> Date: Mon, 27 May 2024 15:33:05 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] media: mgb4: Fix double debugfs remove To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Martin_T=C5=AFma?= References: <20240521162254.3025-1-tumic@gpxsee.org> <785a3e80-7cc8-40e6-8e4f-f741a8f343af@xs4all.nl> Content-Language: en-US From: =?UTF-8?Q?Martin_T=C5=AFma?= In-Reply-To: <785a3e80-7cc8-40e6-8e4f-f741a8f343af@xs4all.nl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 27. 05. 24 9:36 dop., Hans Verkuil wrote: > Hi Martin, > > On 21/05/2024 18:22, tumic@gpxsee.org wrote: >> From: Martin Tůma >> >> Fixes an error where debugfs_remove_recursive() is called first on a parent >> directory and then again on a child which causes a kernel panic. > > I accepted this patch for v6.10, but I would appreciate it if you can > make an additional patch for v6.11 that removes the #ifdef CONFIG_DEBUG_FS > lines where possible. > > Most debugfs functions have a dummy implementation when that define is not > set, so it would clean up the driver if these unnecessary #ifdefs are removed. > Ok, I will do it and send the patch in the next days. M. > Regards, > > Hans > >> >> Signed-off-by: Martin Tůma >> --- >> drivers/media/pci/mgb4/mgb4_core.c | 7 ++++--- >> 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c >> index 60498a5abebf..ab4f07e2e560 100644 >> --- a/drivers/media/pci/mgb4/mgb4_core.c >> +++ b/drivers/media/pci/mgb4/mgb4_core.c >> @@ -642,9 +642,6 @@ static void mgb4_remove(struct pci_dev *pdev) >> struct mgb4_dev *mgbdev = pci_get_drvdata(pdev); >> int i; >> >> -#ifdef CONFIG_DEBUG_FS >> - debugfs_remove_recursive(mgbdev->debugfs); >> -#endif >> #if IS_REACHABLE(CONFIG_HWMON) >> hwmon_device_unregister(mgbdev->hwmon_dev); >> #endif >> @@ -659,6 +656,10 @@ static void mgb4_remove(struct pci_dev *pdev) >> if (mgbdev->vin[i]) >> mgb4_vin_free(mgbdev->vin[i]); >> >> +#ifdef CONFIG_DEBUG_FS >> + debugfs_remove_recursive(mgbdev->debugfs); >> +#endif >> + >> device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups); >> free_spi(mgbdev); >> free_i2c(mgbdev); >> >> base-commit: 8771b7f31b7fff91a998e6afdb60650d4bac59a5 > >