Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1102987lqo; Sat, 11 May 2024 07:30:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUY16FbEG4YfWIyxFuvTYFG2+WkZDaj28lqZLtGoygF+2tEd9QDYgSOFjtaP0UiOGhHk7HYDo+CZRBkurF32ozCor8n5SfO9SZ39sJHdQ== X-Google-Smtp-Source: AGHT+IEblrJkCG27J73WUqL3K1Z+NpMwHaUyuowez3Q3/Rlce3EbIMKSMf7rSjDA9TJcnOohrAjg X-Received: by 2002:a05:6870:6e86:b0:23f:a988:564 with SMTP id 586e51a60fabf-24172c5d5cbmr5566851fac.56.1715437820581; Sat, 11 May 2024 07:30:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715437820; cv=pass; d=google.com; s=arc-20160816; b=pSj0mplgreFIWVYcItFNpWXJrvdx+/HV3notbLnUN2LjKCvt+AKc2T4+D7ho8PlrBP rGJQNgajDpgjQ5qk8vd0Rd0zAJG/3a3KnS+g6Qnsyccawjw1gmRp+HGTLS2TyiWbnOVl cT/Cn1+3elmX4dYHQmwPE4qeSGEiyAaMTn2nk4QBD00k9chYUGQbPcExSAl7sOio0A1c azp52t8eQ5TomAvqo0eSkIxVj1MWumIgyNp0+4HrWo4w3wJA8CxRScWNNq+KM7SFLefh FhHuLsRnbN5wpgD13lS6hVZioKqzeOCcpPAlIDncsfIc8Hvk51MmushwvgvZdjX/4NGg MnvQ== 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=5MHosLGyMfOMQTFlE11a37ZDMCC9zCbFJQj+2H5rwUU=; fh=Pv+qokqS8rjX+3E6edMCSZFyqUweTlGCrWsijIRNnSk=; b=YWqqhYPWFRzUJ/Tl7LMesW/rVMc9jNLDFBjnuXAxwn6n0pxdJM2Umq1qfVDgGZmKey gVdztoyHgWOqrPUUffvz99HeXmbgHKFNTzrvz6nXQ/F8cqM3tP7DGTz07DjvWmuTccwI pnbyPsgMoTnXwdnYRYoZYlqN+kfgdIiSKTP/6cYknJHhVi703ASVdLDfg4Ibrri5oE7l FcVOUmaZVroqJetHESAkrhMzVA+VLghKGMYm+UxbUITIPrarTcWSmTE9UJqSbFfl3Jqb cTL0PWlrrZOlyeuRl26jvEvyH06lE35Ww8RSfsfeIt6SHbQtJ/ckRnZZJPJaiIV04H9k YYIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Hf91AIkh; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-176577-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176577-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf30a56dsi570811285a.315.2024.05.11.07.30.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:30:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176577-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Hf91AIkh; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-176577-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176577-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 4860E1C20CB7 for ; Sat, 11 May 2024 14:30:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC69356452; Sat, 11 May 2024 14:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Hf91AIkh" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 6F6C154675; Sat, 11 May 2024 14:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715437811; cv=none; b=nUPAtKUVRuD6YDNuQ7W97UFqoevfRp0WXDr4e6yk+z7lbj/xN/QTuSofqSEzuJv2i5F0Q/kz9WZ2EvLVdL/vlIeeNVHvoOjIrukyZ6+xC/UJpB59YVd71T3X9MmZ1aflBG8MB0+sz6VawVeHNk3e9Z24R4x81+2bXHCKFSd+PZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715437811; c=relaxed/simple; bh=Ljf9kyd52InGJKqfdBuV4Ah4NYoQ0uueOOS0D+QxAlE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=adqaZeZsj6mMgDAnpUzMQIPcG31zWbBvKuhTn34Eyyb5adj76feXHhYieb8/BCDgb2uZqGfdEwa93YUmBQLZsCEwJz5KOKL35LWGH4slrp+otQCrapX8uYn77HmBR8NgDUjDGK8sS/PhtF6kb9C/bOQXMIQW8SbDIdjYsmUqnV4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=Hf91AIkh; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=5MHosLGyMfOMQTFlE11a37ZDMCC9zCbFJQj+2H5rwUU=; b=Hf91AIkhkaSC/B2WvhNWfwFnWf Kq/EjgoDVI6qd9M6wXYFCYedTgtUun6AbuF8yvyUPI32/G6ilEsrdkmELeZYD1x4pyjh33PZ++2ok xa0UUy15UX1uZDoqYtGX2wzPl4ea9Pyie9+77E5Iu29n/yCdXDzpTH2O/k/0BGTruXz0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s5njP-00FCTL-Pz; Sat, 11 May 2024 16:29:47 +0200 Date: Sat, 11 May 2024 16:29:47 +0200 From: Andrew Lunn To: Wei Fang Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shenwei.wang@nxp.com, xiaoning.wang@nxp.com, richardcochran@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: Re: [PATCH v2 net-next] net: fec: Convert fec driver to use lock guards Message-ID: References: <20240511030229.628287-1-wei.fang@nxp.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=us-ascii Content-Disposition: inline In-Reply-To: <20240511030229.628287-1-wei.fang@nxp.com> On Sat, May 11, 2024 at 11:02:29AM +0800, Wei Fang wrote: > The Scope-based resource management mechanism has been introduced into > kernel since the commit 54da6a092431 ("locking: Introduce __cleanup() > based infrastructure"). The mechanism leverages the 'cleanup' attribute > provided by GCC and Clang, which allows resources to be automatically > released when they go out of scope. > Therefore, convert the fec driver to use guard() and scoped_guard() > defined in linux/cleanup.h to automate lock lifetime control in the > fec driver. Sorry, it has been decided for netdev we don't want these sort of conversions, at least not yet. The main worry is backporting fixes. It is likely such bcakports are going to be harder, and also more error prone, since the context is quite different. If done correctly, scoped_guard() {} could be useful, and avoid issues. So we are O.K. with that in new code. That will also allow us to get some experience with it over the next few years. Maybe we will then re-evaluate this decision about converting existing code. Andrew --- pw-bot: cr