Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3374617lqp; Tue, 26 Mar 2024 07:35:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFL/7MON9b9DRnrE944YiFsJSYckXoN7aR1+UQEvtcyaXhGQ8rhOh988m129nEtQyegKZgwEFKgFA/7BuX8ziZ8s1FAnoEsG24K52aIA== X-Google-Smtp-Source: AGHT+IE/rUF8eZQiV4QSn6unFaHW+kuAqstu1mIacyt+PFWQ2EffsLKbeBYUCMpyLRy/aELdHtN5 X-Received: by 2002:a05:6402:1654:b0:56b:aaf5:e546 with SMTP id s20-20020a056402165400b0056baaf5e546mr1412404edx.16.1711463759170; Tue, 26 Mar 2024 07:35:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711463759; cv=pass; d=google.com; s=arc-20160816; b=YP0/i/thBnh/67md0iHogTw9s9o1aErkkUCct+cstAH2wx8JvqQLWZLqtMk2alvAjm psG5YWdDKVcEZ1CoY/e7d6Fkm+LF1f0CahVm9YksGCzuTvkseTAYXdrMUvRw/r90WJU4 pROfWkN6jLuFxlP4eCO/kq/Frwt1ArKPrvwHjgimY6fRfwgjivJFgmU6+CtNor8CxCjr jQ1/oNFR3vyR2BANYjfslRQqm9c+b+QTI89qQoS/NWMWDd26g44Od8YXEZZmccmSW7VK efANl5Cl6J9PIj0MmeJ472tYChRM9ON8JSfRjCAe2vjW9zugiq42fHlURWr7w36VpflX B6gA== 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=oXBFibEBiPM4VCyCNwTgs7WkYgc3NnouQzCupROCtGM=; fh=B0aQYQXGuEhK84YRFTiA071PPtB3D13kZTHkAUtOisA=; b=Bz4gcuq1oz7CluEIdEVgdYNfQLYJMDvOn5aXeDE40b7jVwyzetbnD2GagFtey8xp7A lJm7kCUmcRYhQRR00PsXRjjn9paThUQ3LaYXh3+q1ubjvyQyqYP1hRwR8nWkg7Sm6Zn/ GVkFcG422+n1wmdtEPlICJjstuGgnf1bGfzDGHvgLUOnBvzEsvj7s5eJbD61k7/89bi1 NIqwBLYQZhcgqylgbmFHJ0s1lm2HCPhku56UsPqPgO/ZXLmdaD3v4QIXMH2O1Zu+FkM7 seQodcyfB9/GYpgnbOIujBdoGRiepE75XsatU66cc6+sPtEgF/qPXr4sB1OApw/plMMP g8Ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ljOk2w0Z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119187-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cs15-20020a0564020c4f00b0056c1c913befsi1352463edb.631.2024.03.26.07.35.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 07:35:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119187-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ljOk2w0Z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119187-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 D86F61F3E5AF for ; Tue, 26 Mar 2024 14:35:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBA9913C3DF; Tue, 26 Mar 2024 14:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ljOk2w0Z" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F240713BC3B; Tue, 26 Mar 2024 14:35:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711463750; cv=none; b=dQmxNnaNAicA0kpoQDcTTnVlKPl+78r+nfoFz43spgfhnrwr6/9XxGLQG/YECgh7rTSPalZqpzIanqfbGBPY1gc8xKfUueQ00gNlWVclR1YodRcI9qTOd/8OYRHRtZhZ7HP2O2iBP6MQfSJHNRjO2RSotx0zxGKZUf6OB7yh9Y8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711463750; c=relaxed/simple; bh=Ni4Cb8d+9/UtZWDS1MJ8TsKOaKB5beJmlBXXrWRHe/I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R/EwqO4bVoy570OXruyjwfceJU/Hcx3reSec+LguVAcuusTTPOIrbtxW5sQtANHa6UjtGl9bBdvFpxpXOtms4sZeXN3LcF6ya9sJ5QvhqNuBt0mP7PlaSXIb43K5aEBAjfP8GCNDPcn9zh0EXcCEP2BBK/wYMepKHfamCSz1+1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ljOk2w0Z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67517C433F1; Tue, 26 Mar 2024 14:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711463749; bh=Ni4Cb8d+9/UtZWDS1MJ8TsKOaKB5beJmlBXXrWRHe/I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ljOk2w0Zq6ZBjwoNgc5qsqetXQWZmTaojsWyb4v2XxO43hoAfYg8lGvzDZDaieq/F Dw6U/mn3/Cr60E3fGpxQ96TdizogFMEn4pserO15OvwzLFRz+U6mHZFLTVv2qOcEJg lbpFSXHuUX3JdnzuFEXUt5TJhX+4SfVBhgcHosNerAhkIGwtMINQqM5dNASgF4guHv +diZgWE7Ecr4m5YEgNirWGkme+EArfZw9tEg25ZDGVzPxqpDfmXb8rNgTQ4tCZzo+9 mwv0xDYZyGHfagGaScGs9ry9dDrnxjcD5bYe6AICWUKg1LNCPyGOlYD7do/3vHYhi7 fzJMSBkVa99nw== Date: Tue, 26 Mar 2024 14:35:44 +0000 From: Simon Horman To: Bjorn Helgaas Cc: Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Konstantin Khlebnikov , Zheng Yan , Sasha Neftin , "Rafael J . Wysocki" , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH 1/3] e1000e: Remove redundant runtime resume for ethtool_ops Message-ID: <20240326143544.GY403975@kernel.org> References: <20240325222951.1460656-1-helgaas@kernel.org> <20240325222951.1460656-2-helgaas@kernel.org> 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: <20240325222951.1460656-2-helgaas@kernel.org> On Mon, Mar 25, 2024 at 05:29:49PM -0500, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > e60b22c5b7e5 ("e1000e: fix accessing to suspended device") added > ethtool_ops.begin() and .complete(), which used pm_runtime_get_sync() to > resume suspended devices before any ethtool_ops callback and allow suspend > after it completed. > > 3ef672ab1862 ("e1000e: ethtool unnecessarily takes device out of RPM > suspend") removed ethtool_ops.begin() and .complete() and instead did > pm_runtime_get_sync() only in the individual ethtool_ops callbacks that > access device registers. > > Subsequently, f32a21376573 ("ethtool: runtime-resume netdev parent before > ethtool ioctl ops") added pm_runtime_get_sync() in the dev_ethtool() path, > so the device is resumed before *any* ethtool_ops callback, as it was > before 3ef672ab1862. > > Remove most runtime resumes from ethtool_ops, which are now redundant > because the resume has already been done by dev_ethtool(). This is > essentially a revert of 3ef672ab1862 ("e1000e: ethtool unnecessarily takes > device out of RPM suspend"). > > There are a couple subtleties: > > - Prior to 3ef672ab1862, the device was resumed only for the duration of > a single ethtool callback. 3ef672ab1862 changed e1000_set_phys_id() so > the device was resumed for ETHTOOL_ID_ACTIVE and remained resumed until > a subsequent callback for ETHTOOL_ID_INACTIVE. Preserve that part of > 3ef672ab1862 so the device will not be runtime suspended while in the > ETHTOOL_ID_ACTIVE state. > > - 3ef672ab1862 added "if (!pm_runtime_suspended())" in before reading the > STATUS register in e1000_get_settings(). This was racy and is now > unnecessary because dev_ethtool() has resumed the device already, so > revert that. > > Signed-off-by: Bjorn Helgaas Reviewed-by: Simon Horman