From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3090AC27C4F for ; Fri, 14 Jun 2024 01:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=88dKCpZy3JYAEMg5JQvnT6/IrmllsAbq8TRuMF6c/MU=; b=pHGA8LFacYpdshzscpdBDTRkSY RTWgVvwtnkwNrGYm5thPPX6uv0akJw/6riMiWeT2nK0nCHY/H1hg55DtT31YgH4m/wulCM+hXSPZC 2K2QiZ9KhYbINWgReoOp+t7wlQmM6FnCfCZpwky2NQ5NEeURNIrIhdWj25ZGOmEhnP2ro1rZNlV8f uV0bGHkiCHDBsqSUi6U7Vo768RbGXxKMemL+7rMi1VOPCCwDuG0dNyN54gwR5Zz7sjWZBsN7J+rQj xyH5NYXsfmZ5QcpPhdj+QWyoeZ7rwGTsrSrjpoBejFc9BrADEUaY62T0kx3mJoVsVcq28h09xgSJ/ bFVo1ONw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHvht-00000000zOw-054W; Fri, 14 Jun 2024 01:26:21 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHvhp-00000000zOW-2Cu2 for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2024 01:26:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 49BA061793; Fri, 14 Jun 2024 01:26:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA883C2BBFC; Fri, 14 Jun 2024 01:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718328375; bh=kLV3z/ZGpX0PFgVq4+W+L1l79K/SNekMA3Nls7V9LDI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=p5yRX/sgFHhSCyE1qpFsoNIBt6Y2UZ6rkbsoHegv2vTVfzQ55eJys+UTgCg6D/l7M qxA6M4OM2bP4dPGmlTaSlSNQjHisl3Hq/uXybTsbLT6lchJxJlmVqUG3lNChcddAku kD+1/v56gaENCnMg3QzlfBgjd5EAmb+WWrms4Nbl2XnlK4xyBVfizfeD1zA+lpUIaN gLT1wkY3WkXsSS7NHdNvbwxrA8Tc2ga+sTxyeCFogKX7R5GgEmCGHXzwXAdwYdnzgT jz7IYVTSxuMSb5qJApf88t5mUAShqacevfS4YPuoHNfBYZjiOEtEqBAr0Gday3MrMP SnFGAiAt4d7og== Date: Thu, 13 Jun 2024 18:26:13 -0700 From: Jakub Kicinski To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart Subject: Re: [PATCH net-next v13 05/13] net: ethtool: Allow passing a phy index for some commands Message-ID: <20240613182613.5a11fca5@kernel.org> In-Reply-To: <20240607071836.911403-6-maxime.chevallier@bootlin.com> References: <20240607071836.911403-1-maxime.chevallier@bootlin.com> <20240607071836.911403-6-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240613_182617_670970_A07D003F X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 7 Jun 2024 09:18:18 +0200 Maxime Chevallier wrote: > + if (tb[ETHTOOL_A_HEADER_PHY_INDEX]) { > + struct nlattr *phy_id; > + > + phy_id = tb[ETHTOOL_A_HEADER_PHY_INDEX]; > + phydev = phy_link_topo_get_phy(dev, > + nla_get_u32(phy_id)); Sorry for potentially repeating question (please put the answer in the commit message) - are phys guaranteed not to disappear, even if the netdev gets closed? this has no rtnl protection > + if (!phydev) { > + NL_SET_BAD_ATTR(extack, phy_id); > + return -ENODEV; > + } > + } else { > + /* If we need a PHY but no phy index is specified, fallback > + * to dev->phydev please double check the submission for going over 80 chars, this one appears to be particularly pointlessly over 80 chars... > + */ > + phydev = dev->phydev;