🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21089

Re: [PATCH v3] net: dsa: mt7530: manage the core and io regulators with devm actions

#21089
From: Andrew Lunn
Date: Mon, 23 Nov 2026 14:46
27 lines
9109 bytes
> Move the enables to mt7530_probe(), right after the regulators are
> acquired

Please add an explanation why this is safe. Since the original code
did not do this, there might be a reason it is done later.

> , and pair each regulator_enable() with a
> devm_add_action_or_reset() that disables it again.

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html


Using device-managed and cleanup.h constructs

Netdev remains skeptical about promises of all “auto-cleanup” APIs,
including even devm_ helpers, historically. They are not the preferred
style of implementation, merely an acceptable one.

This is maybe one case where devm is the wrong solution. Please keep
with the normal way of doing cleanup.

> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")

Who does this bother?

    Andrew
Technical Details
Message-ID: <426c9bff-1928-4829-a3e0-dc021e4c783e@lunn.ch>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369491-linux-kernel-netdev=dewy.ru
References: <20261123022415.433-1-laixiangwu@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369491-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v3] net: dsa: mt7530: manage the core and io regulators
 with devm actions
Date: Mon, 23 Nov 2026 15:46:21 +0100
Organization: Usenet Network
Message-ID: <426c9bff-1928-4829-a3e0-dc021e4c783e@lunn.ch>
References: <20261123022415.433-1-laixiangwu@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3904613"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CzNnXsde8ZxW0YN/vMZnzjC1HyE= sha256:hsHSENN0yzv5TRR3rEGiF8i4iVJEFWcQlve564C0vPY=
	sha1:5SgSlzxRk9lWwrLgGncoBVyf4Y8= sha256:EE6PIzp7NwopPSvXeqscv106M5wNJXnUIGDp95qmeX8=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 33DA1125DBB; Mon, 23 Nov 2026 17:47:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=lunn.ch
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QafuuMsJRJGc;
	Mon, 23 Nov 2026 17:46:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369491-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 8AEF1125DB7; Mon, 23 Nov 2026 17:46:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 9C7C13242C; Mon, 23 Nov 2026 14:46:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795445204;
	b=sXBYL2KxQtIw4Wqm+3YxR0/lYr6vXnp//Rf4AKWvpJ/gySVJPfktyApOoTG5lcOZ0vgv
	 +VuTVNtCbF0pQTLXSlGgO38yJ2ob3JnD3640WWyuf1H9qhbcqn1Xg6ED9GuvKwnI3mrnq
	 XJF+ldpZgY6Xg0BV+FMCLo4SuMragerg/xnW7v7t4SsN+GJ9V6IM+mS88h+hZlcZrIgil
	 eFAl2zofEOHZ1/dJ/dOjLb7Vw2z65Mkh+tq5dkfyWOPojEl/gnjWrU/piJ3BKXKF2oGPX
	 lB9XLQqNcA8TBJG+SlzeND3CUulqCGQiWsgoTiGwKyY+4byeZ5FSQCVxQJBVX9/O8ZA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795445204;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=+MlS4fSU67YArcCoU7ctXyPr2zLNy9Ek06CnLyNZh6E=;
	b=DOgwjCH3Li97klr2FHXUkzGn9fsCNVHlY0Itg7RJBcsJXnkxyC1dJFvWpOgv6HKglert
	 0KOW+4710BVypBIv3ut8WxwWZ/FAjTVyGa/jEscyaYrkjmx1ovOtidZA9ti/8Pqt2Y1dE
	 W/9rtKaxCZWoTro0BKyyvc61npVFoTdOl2bRlXUxczQkBX9gr3ul1y7gzGZGIFnT2E3Dz
	 1DchQWy2mo84daG9u9eQZ7B9nOnZrVlQTBTU//fGttip2VfZHmSnj7izD7n5QPA6jhbLw
	 /LpH4YRui3bslob4B/9XcwurK3P49jZOGsCDrTf/wmpOhasqevuwFnz5eAAOtRVpQWA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=FJ7DLqfr;
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id EFC2C606A32C;
	Mon, 23 Nov 2026 14:46:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=FJ7DLqfr
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795445198;
	b=Q8z0FV3j6C9lV51MF81fg/+uwzgkgEkMyyV9nY03IAk5JRkBdqTrY1Vp4iy2IrtAcYaj
	 dCuA7XuBfYr69Ogv8NVUYpYd5ZC15rJGrWvjebSvTP80HjpFYdvSl/uL1We47JA+5jDJv
	 MWWolh32eCNBNqDd+fyd60F8ItnA8pqlAtvDupS+al+4bKpGR9+/S+PTgCrw+757vJR9B
	 nuN49Rzfz8BC7Kxf3ZmvMJJxxVYkyBEAGASB62ql7KEwO9rJn9+6gCeClT65RSc3m8Ium
	 2BWM/ziahJMMQDm89jBX8NzYruROf5aZYeLjMzKHWpshvRatuMx+f+FRXFFJm9wEUGg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795445198;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=+MlS4fSU67YArcCoU7ctXyPr2zLNy9Ek06CnLyNZh6E=;
	b=upZFcUX0M0LeJPD0CU32qYIiqmlwGrwJ2B0KJxRu2dYcZswP9MFF1+KpYRAA6TvblHyG
	 3BZZijjNx1NGXJIrIS3i5g3FtqzVwBYoihri+HIKY/DFtvyV8HA1peJ/6YzoiRVvJZFAD
	 mCSpLdwXEkIZtC/U+ttjjJ2LdExLCBfzWYoGQYdFKiDPZe4suHkVVQ195QdM9+MuLfn29
	 Gjtujug3+bTOSGz3oQPJUCiJwGIo/nfdqbJpSMXHUU1IC1evhSdaGwKcSAg8mEEoyWlp3
	 qtg+MzGOGj2KEgc0+ogFkwSjN+SWFfDWJ0CO5IEk95RQgBYwT6bMXrMrL29CU06eHlA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=FJ7DLqfr;
	arc=none smtp.remote-ip=156.67.10.101
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD95B606A334;
	Mon, 23 Nov 2026 14:46:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BD95B606A334
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Transfer-Encoding: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=+MlS4fSU67YArcCoU7ctXyPr2zLNy9Ek06CnLyNZh6E=; b=FJ
	7DLqfrN5mZbp9W1ddDRhm2gNKEN5Mg18QBoSGzrACAD7P8VlQWAEL6oJe6qGciDrRMe6nLjTjSeOx
	GSCvXabfuJiVh/iBDsHdNj9AcKfXn/RsTO1TD1EIMRM5UzPmv+DnT9dEcq+vVxtsmrXz7xefm8eXW
	OnA7xme+OwfeFcc=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xVVJF-000o2V-92; Mon, 23 Nov 2026 15:46:21 +0100
X-Cc: chester.a.unal@arinc9.com, daniel@makrotopia.org, olteanv@gmail.com,
	sean.wang@mediatek.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev-bot+sashiko@kernel.org
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261123022415.433-1-laixiangwu@cmss.chinamobile.com>