From patchwork Thu Aug 29 20:48:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13783868 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 130A0CA0EC2 for ; Thu, 29 Aug 2024 20:50:27 +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:Cc:To:Message-Id:MIME-Version:Subject:Date:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=VFLjaq4t+p4ySJaRjHHMD+djaojUeqjD8JR+7Pp4jkk=; b=4fGUEOU+GXa/NzkqkYqserTqIq +GtLTKwt9VyEBCkCqqvj6jTTOgTuzaSedN2t/JkOeFuWSWS9Mqg5fR3Fcx7Kc7jKf5yMwKaBojK7J x+o+iCMXLPirJRNhOMDsl6K30A3YN8ZyJKMsDCphc6ZiCpA/ynjjwEo6t571lHiq+DYTp9GD3xD2B mHORz6J73dBklO214aqx7OjGY5wkCrLcTyesvCnJfl8ALIPvOwVOsLjyo7j7gUMacwRnpA5TJd88s oaFpbTvYHPeUJx3DHBuJthjyxABrKF5PNwN9warhy8YJbsdR14feuvMfBGUD5+/wMnszwxK0OKGKz twUlvzvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjm5v-00000003bZ0-22AT; Thu, 29 Aug 2024 20:50:15 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjm4v-00000003bAO-3BmL for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2024 20:49:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724964552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFLjaq4t+p4ySJaRjHHMD+djaojUeqjD8JR+7Pp4jkk=; b=OdCHcqFwN8ksVqYirW/BddKBBpHMLZKubqDJ8EbMNU/fXLfaaJ2flzd2YxHW9kKiitRjM+ 2v9o+nLOtM/u1iiK1We63+mum5sZ2NtJQeuJ5eTAO6TjdhdIRQW4nXuuWD6ufC6Qb2r8DQ ZSnO+1OhPB8zbvDvpVZk6mRKVpgFHso= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-137-x55C6qJ4Pgue6w63lmtZcg-1; Thu, 29 Aug 2024 16:49:08 -0400 X-MC-Unique: x55C6qJ4Pgue6w63lmtZcg-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-44ff196bbfaso14218261cf.3 for ; Thu, 29 Aug 2024 13:49:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724964548; x=1725569348; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VFLjaq4t+p4ySJaRjHHMD+djaojUeqjD8JR+7Pp4jkk=; b=CBEUxxx/zEnAswoXVTkbGsc2qwIMFkiQ+vcpOocwQ2julkI7m0iK0ydlFnuSGbc0CG yxpKgM9gEiGvqhao1Jo8v6xABTxcokq6nhioJzc26tfCFzLwfwrVkB3VHl9TDd65DcYX RMwJktTsdpX1/FgIABSXV/tkXZa541ZUSgpKkvVZlHS4ESKxyp8tkopQVC7M44GimUbd vdTHq3aQhT72f0XARl+NrwHOfnjQ7yu7n85Zt1f01WX+RLdUL3BWajdZR8kXfwILschI KXVI0P60xxMIIK4EMTo66+DQyQWu98XlARJNiy7gPjzc65m5CrwsKYNRs2j9KKFm6CGr aE+w== X-Forwarded-Encrypted: i=1; AJvYcCVtrHByVcTJIQIYSTTdHsaNGUGgMbo41IP7zuPEBuxyTpnlp92ORyaFxUYQXLdRzd1re4zJPzkmxhGiOF4ImlAX@lists.infradead.org X-Gm-Message-State: AOJu0YzMMt9k2XImAZG7QLmtzF2tXaVea1OIKDIrRKRDEuRMHQp4fz2q yEclgPWSXuU+Bia/IPZ5FEM+CAgMICuQxSRKlXTDWY+SiVcC0HEmg3jRxDPtKGhtruW1GT9gkbn yKKlJunz4jOwzVpBdA+AR+S95DJL8gw/uITid/pfjpHcLHbZ0oJtkmPKgcYPBeYLnksEgKWZA X-Received: by 2002:a05:622a:578f:b0:453:5d83:6275 with SMTP id d75a77b69052e-4567f580d8fmr43858651cf.34.1724964547719; Thu, 29 Aug 2024 13:49:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeb+yBjMEz9BPdapOW3IkPpcjpvG1lfzUxlrzusYIy/pZk9xn7Op0zmI0YQmjcAC+y5+roSg== X-Received: by 2002:a05:622a:578f:b0:453:5d83:6275 with SMTP id d75a77b69052e-4567f580d8fmr43858371cf.34.1724964547321; Thu, 29 Aug 2024 13:49:07 -0700 (PDT) Received: from x1gen2nano.local ([2600:1700:1ff0:d0e0::33]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45682ce3058sm8168951cf.52.2024.08.29.13.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 13:49:06 -0700 (PDT) From: Andrew Halaney Date: Thu, 29 Aug 2024 15:48:44 -0500 Subject: [PATCH net-next v2] net: stmmac: drop the ethtool begin() callback MIME-Version: 1.0 Message-Id: <20240829-stmmac-no-ethtool-begin-v2-1-a11b497a7074@redhat.com> X-B4-Tracking: v=1; b=H4sIAKze0GYC/3WNwQqDMBBEf0X23C3JNgj21P8oHmzcmIWalCSII v57g/Tawxwew7zZIXMSznBvdki8SJYYKtClAeuHMDHKWBlIkVGGDOYyz4PFEJGLLzG+8cWTBHQ 31TpyusZAXX8SO1lP8xMCFwy8Fuhr4yWXmLbzctFn/7N3f+2LRo3K2JY6q6029Eg8+qFcbZyhP 47jC+FGFz3JAAAA To: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Abhishek Chauhan , Sagar Cheluvegowda , Dmitry Dolenko Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Halaney X-Mailer: b4 0.14.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_134913_908624_856A2866 X-CRM114-Status: GOOD ( 13.46 ) 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 This callback doesn't seem to serve much purpose, and prevents things like: - systemd.link files from disabling autonegotiation - carrier detection in NetworkManager - any ethtool setting prior to userspace bringing the link up. The only fear I can think of is accessing unclocked resources due to pm_runtime, but ethtool ioctls handle that as of commit f32a21376573 ("ethtool: runtime-resume netdev parent before ethtool ioctl ops") Reviewed-by: Dmitry Dolenko Tested-by: Dmitry Dolenko Signed-off-by: Andrew Halaney Reviewed-by: Alexander Lobakin --- Changes in v2: - Rebase on next-20240829 - Drop RFC/RFT tags, add Dmitry's Review/Test tag - Link to v1: https://lore.kernel.org/r/20240429-stmmac-no-ethtool-begin-v1-1-04c629c1c142@redhat.com I'd still like a few more folks to test this to feel more confident that I'm not breaking anyone, but at least I've gotten one on list feedback and one off list that its fine for them. --- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 8 -------- 1 file changed, 8 deletions(-) --- base-commit: b18bbfc14a38b5234e09c2adcf713e38063a7e6e change-id: 20240424-stmmac-no-ethtool-begin-f306f2f1f2f4 Best regards, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 7008219fd88d..220c582904f4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -438,13 +438,6 @@ static void stmmac_ethtool_setmsglevel(struct net_device *dev, u32 level) } -static int stmmac_check_if_running(struct net_device *dev) -{ - if (!netif_running(dev)) - return -EBUSY; - return 0; -} - static int stmmac_ethtool_get_regs_len(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); @@ -1273,7 +1266,6 @@ static int stmmac_set_tunable(struct net_device *dev, static const struct ethtool_ops stmmac_ethtool_ops = { .supported_coalesce_params = ETHTOOL_COALESCE_USECS | ETHTOOL_COALESCE_MAX_FRAMES, - .begin = stmmac_check_if_running, .get_drvinfo = stmmac_ethtool_getdrvinfo, .get_msglevel = stmmac_ethtool_getmsglevel, .set_msglevel = stmmac_ethtool_setmsglevel,