Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1983139lqo; Mon, 13 May 2024 04:46:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV28FLFP5SJmA6XqwLv/N7Ppzgi5AuIhKUkGJXh6MVpJwSVvOvNX8HpEDANts0mT6GM0jsU8k0CLo2AIq4vNL/pAGYhHUl47fh7lVyfsQ== X-Google-Smtp-Source: AGHT+IEGuMNL6lE/pp46TUUOJbindKfLYsY+9b+byGUVjTLtH/zThypDKC9CEhrqHBKaJhn78vfS X-Received: by 2002:a50:9b42:0:b0:572:3b3c:754f with SMTP id 4fb4d7f45d1cf-5734d5c16f6mr9342982a12.4.1715600767258; Mon, 13 May 2024 04:46:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715600767; cv=pass; d=google.com; s=arc-20160816; b=zX3vjrKwYDvn8jUg9gNZta/AtMq9jZJUan1DR1dhVLqIRfduIIt4slFU6QBG1XyU9s OsicMaP+rXAKu6k1gsnSvTmvIbpwOIKI9tPTqD1bPDLcdPofh4ezIo4GSBHe8FqXNsNa ohPPgB/L0FSsGwuiMZbENlSKjh8DU7n7w/HpAlI7mQ3IpCTn3y1clGJkvBKhJPwKL4BB xogFnfGEsjAuntlCkXWhuplfxD1zNemKI4TFsFQXPGubLLnUDsYH7X/8U8BhE7tXSJyp nfnMi29LancyTRE8foR/vTbo85OBH2d3ZIW6luqUlI6tnQmcc+9XTHLGnQ+JjxLL/5X7 1Spw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GTFJwAhsvw+4KQvCJw4/pGIDLQsq2qRFdEMMdsSRu3w=; fh=516xFJljqVivz3xto4jJQy7vU1gDQ4H05G6QpDk7/oM=; b=jlsHnyldZ/LMK2wakqG2pKJr6xgNAUbNTXadzk8n0MR3eURhwJ3OxEOeypxyhV4pbw x24FuaFJXZ54ZJhv+k0oITi7cvXCZiHx4TBBolJ/GCqU3YzqFjaxn62RVdxOjNRysKxv dDsyuEs3DEUfCHg+f7T1f16fsDKG45dl4GnnNQmFPFUhUC3pT+BJGWDAwIe4mAOXY52u aZiN74d3dmV8oZTj+xrep+duu26qk2lU5kvMI7fQ0AzN7xVRgfGgs1HiOe/1lL9X1szL 9t9yLPqn+hjexWqBjQp4HvZ3ih3HaM1cAZxtV6xRWt/twsiFPtUe1D8taN5Mzzq0cHRl vHGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=h02zrtwJ; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-177518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d54f3si5003420a12.323.2024.05.13.04.46.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 04:46:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=h02zrtwJ; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-177518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0293E1F22CBB for ; Mon, 13 May 2024 11:46:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DA401509BA; Mon, 13 May 2024 11:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="h02zrtwJ" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 E3C2314F102; Mon, 13 May 2024 11:45:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715600718; cv=none; b=qIdiFVm8QQvMmIe9/eNwZyOE8ewbWIbxLHLadmLVMwfH6+k+zc16WEtRCFrkxY0sfmmb66sq3TUH4iamIZ5V8H5OBoYOrTe6NeI9Cu5AYQMLbkKSdfHBgDF0wCM5vGUW0C/ysxA+RryYq7U2QhXAO52YmfvpZ23RZpFE2P2qkG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715600718; c=relaxed/simple; bh=eAyTMUMGGuqdLpsBgzQWqQ1HResoKyZy1l6rRRccU3g=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=acEYlAjWFqwwOLtgs0aUk0yH8Mc2qtM6sSWVLqtUc+MM3cZcvau2EixEYpW1WC0qBe0TjapZoxuoaspAlXghLvgSwyHUoseyTOzq6EfWL1P6kcdVvZNUCsSjIZUH4IRPZohhA57oQN7x7fjTjb4dfMEELidTzxd/incKvFI6H7I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=h02zrtwJ; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1715600716; x=1747136716; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=eAyTMUMGGuqdLpsBgzQWqQ1HResoKyZy1l6rRRccU3g=; b=h02zrtwJZyDDMuzOEnq/jEE9jZ2f+N0PnhzxjGCl05YUrAmpU14AyDVX JQ76mnVd6HeKDdLOMiwiIiIjpvmZxkVmfiepKuGlNcY6zfZ+WRNFyxUos R71tqeym9NSYkhbL6rxS/s6Nlqk3+KiuOscZQEu2An3r8W1RZNQOXUuOd DPAAknzJXWwfYsXkW1LFZd8dQntremg8mCbYE0RTo8SdcQbUVn250+FCl wA8j2WGSpuLTMgvbuTsxKDy4XEJUHzPUmnizeLCIavqlmNbJEuwIgpuhi cjh6toa+hJ6wQPHrd/tX1iC2BJdY6mqL18epah7G3YVPEOc8zrl/3SSbn Q==; X-CSE-ConnectionGUID: bvZzCf3dQ5+hvTmN+nHzBQ== X-CSE-MsgGUID: C9csftaRRSujjB9EEGCyAw== X-IronPort-AV: E=Sophos;i="6.08,158,1712646000"; d="scan'208";a="24493015" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 13 May 2024 04:44:09 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 13 May 2024 04:44:08 -0700 Received: from localhost (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 13 May 2024 04:44:08 -0700 Date: Mon, 13 May 2024 13:44:07 +0200 From: Horatiu Vultur To: Herve Codina CC: , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Andrew Lunn , , , Allan Nielsen , Steen Hegelund , Thomas Petazzoni , Subject: Re: [PATCH net v2] net: lan966x: remove debugfs directory in probe() error path Message-ID: <20240513114407.t2iqcx7txoxkbnlj@DEN-DL-M31836.microchip.com> References: <20240513111853.58668-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20240513111853.58668-1-herve.codina@bootlin.com> Hi, The 05/13/2024 13:18, Herve Codina wrote: > > A debugfs directory entry is create early during probe(). This entry is > not removed on error path leading to some "already present" issues in > case of EPROBE_DEFER. > > Create this entry later in the probe() code to avoid the need to change > many 'return' in 'goto' and add the removal in the already present error > path. > > Fixes: 942814840127 ("net: lan966x: Add VCAP debugFS support") > Cc: > Signed-off-by: Herve Codina > Reviewed-by: Andrew Lunn This looks OK to me. As the debugfs_root is used inside lan966x_vcap_init which is called at the end of the probe. Reviewed-by: Horatiu Vultur > --- > drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > index 2635ef8958c8..61d88207eed4 100644 > --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > @@ -1087,8 +1087,6 @@ static int lan966x_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, lan966x); > lan966x->dev = &pdev->dev; > > - lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL); > - > if (!device_get_mac_address(&pdev->dev, mac_addr)) { > ether_addr_copy(lan966x->base_mac, mac_addr); > } else { > @@ -1179,6 +1177,8 @@ static int lan966x_probe(struct platform_device *pdev) > return dev_err_probe(&pdev->dev, -ENODEV, > "no ethernet-ports child found\n"); > > + lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL); > + > /* init switch */ > lan966x_init(lan966x); > lan966x_stats_init(lan966x); > @@ -1257,6 +1257,8 @@ static int lan966x_probe(struct platform_device *pdev) > destroy_workqueue(lan966x->stats_queue); > mutex_destroy(&lan966x->stats_lock); > > + debugfs_remove_recursive(lan966x->debugfs_root); > + > return err; > } > > -- > > This patch was previously sent as part of a bigger series: > https://lore.kernel.org/lkml/20240430083730.134918-9-herve.codina@bootlin.com/ > As it is a simple fix, this v2 is the patch extracted from the series > and sent alone to net. > > Changes v1 -> v2 > Add 'Reviewed-by: Andrew Lunn ' > > 2.44.0 -- /Horatiu