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 C5EAAC54E58 for ; Thu, 21 Mar 2024 15:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: 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=woZnDU/P4j4/DRgnz88RwSio93lPCNfEnP9sGk4KSeQ=; b=CcXS7pFCegYcMK DL3Zt2bsaK9caJSfKNAGQ5QUT8X1orkBOOqH2yuriEzu+PCcO/s90KKvtVSHQ1n0t2NdnMJB0Euyv E35++uMHfU9s340cyd0NGw57nebqW9fBHQ9fdVlC9dQXVWsVEk8P9NgoUbhVctRWa7CRZTq9i7d3X 3LQ+SJTyBb/Ei8P3HQAbVaL4ejCDkpsLy4uEjgKxOZekPkKsg+3vTo5JqEaIEe5D6LGGs8OPhCxKM H3aQeK1I2z1DF/IIMb9iUJODG4ztAUAWCSVCP4zzvGB4lU7VtR8ahBk2hOn+tcYzXVVCdkOjpnehG 1XSWQlj82+mTyvF11ErA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnJy3-00000003Ogj-49f9; Thu, 21 Mar 2024 15:04:31 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnJy0-00000003Oer-2SZ3 for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2024 15:04:30 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a466fc8fcccso147574166b.1 for ; Thu, 21 Mar 2024 08:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1711033466; x=1711638266; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=C+M26qwP0oSliowXOMgjRNibYsMtGqN5dSYVPUjBSio=; b=UbWfCWwstxgT+BIcViHwSRrpYbrMfR9iQMvxoMhW3kUaVfdUsxlH1DE9vyNoeKQo4r e1hQbm4raeTFzEpKUTTAiHvbgHjsEcRDjBaZ3lFuL1Qcy7TEy0igYAuM5yn4rETOSMWP 1DiMy+71tDGssKoTgLDkHzxnqj3BeBVy0hz5HiH9qIlXP0UtqySGPskTYUDX2H9KpFoR Ve7kZqXrg3awpkRVPrTeAWXVz6J3++ZQ6xUJtmO5GD7jy/7YmS4xP4S5lU9PHBZdxOxj EeUmHtnv2RibFJH9KNa4hji9BYsuaA+n2vTcGO/lYoOiCdLRxNbKPq6M4YoZAycDOyYF RNZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711033466; x=1711638266; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=C+M26qwP0oSliowXOMgjRNibYsMtGqN5dSYVPUjBSio=; b=RyNDj6FVHBjmd3YcEomM3Dll860um/iqfhcV3qGL3BkY7bUGcCZeULFdoJdk6EE5HN 6UlZyNP/WExeH90UeANA+EgE9amR81Ny+tl4o0aGUodeT2XuA1DglZtxAx48srvnnmM/ FVDqrXie/oM8fuzTd3P1kChfU0QJ0ecAmUj62U7Rjcy4Wj5so7NCh89KEyux8InsOP8V j0QcXyGDJkg2Ha9WYQVW9hePUJ9yhJgvvXk1gdRIWxG1ztW7RaS4E/ZrzGs08S2Tpw7L aLhU4XuAjSKshZFxj9RsP2PUQ9uPSHZ24J2peLj7Ks0p6NVlsVAu1e9tctVMN71G7IMI EmXA== X-Forwarded-Encrypted: i=1; AJvYcCW2IeVIGOBqMCT0Io+Y+2/G+aDePeUyA8HM7rgjC6iYoqIOEGY2z9gW2UOnRWGmRW8Lk8NDgEMjQFiq5/c26ptmbPjwoWjyR3tWAnclTYnFV7OJSzQ= X-Gm-Message-State: AOJu0Yz0wLgThoNMKdkKNNUunvsEYt6JVFaFvOVUX6PO7ZF0ryvrstBw PcCo6FmPnsrqNWF63BsUYBRa/2OHcVTKjS6+1d23BG27KTe/modjpxLk9+jDpdQ= X-Google-Smtp-Source: AGHT+IHEcr1Lc61NMyPIBSb8z115P5vSr6cXrLSqEMELys5uxp7RSzY4HAP3yVuJ9q6mhhIjpF5WHw== X-Received: by 2002:a17:906:1817:b0:a46:af3e:dedc with SMTP id v23-20020a170906181700b00a46af3ededcmr1426310eje.40.1711033466146; Thu, 21 Mar 2024 08:04:26 -0700 (PDT) Received: from localhost ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id t21-20020a170906179500b00a46cffe6d06sm13598eje.42.2024.03.21.08.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 08:04:25 -0700 (PDT) Date: Thu, 21 Mar 2024 16:04:22 +0100 From: Jiri Pirko To: Mikhail Malyshev Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: Do not enable/disable runtime PM for PCI devices Message-ID: References: <20240321-stmmac-fix-v1-1-3aef470494c6@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240321-stmmac-fix-v1-1-3aef470494c6@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_080428_769408_4ACFD7D3 X-CRM114-Status: GOOD ( 14.97 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Thu, Mar 21, 2024 at 02:54:15PM CET, mike.malyshev@gmail.com wrote: >Common function stmmac_dvr_probe is called for both PCI and non-PCI >device. For PCI devices pm_runtime_enable/disable are called by framework >and should not be called by the driver. I don't follow. The rest of the pm_runtime* functions are okay to call, but enable() is not. Why? You need to provide more reasoning. > >For PCI devices plat->pdev != NULL. Use this fact to detect PCI devices Sentence ends with "." I assume this is a bug fix. Do you have a trace or some other symptoms? Please add it to the patch description. You also need to add "Fixes" tag. Make sure you read: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html?highlight=network#tl-dr Thanks pw-bot: cr > >Signed-off-by: Mikhail Malyshev >--- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > >diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >index 24cd80490d19..db45d8dbc1eb 100644 >--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >@@ -7743,7 +7743,9 @@ int stmmac_dvr_probe(struct device *device, > > pm_runtime_get_noresume(device); > pm_runtime_set_active(device); >- if (!pm_runtime_enabled(device)) >+ >+ /* For PCI devices PM is disabled/enabled by the framework */ >+ if (!priv->plat->pdev) > pm_runtime_enable(device); > > if (priv->hw->pcs != STMMAC_PCS_TBI && >@@ -7846,7 +7848,10 @@ void stmmac_dvr_remove(struct device *dev) > mutex_destroy(&priv->lock); > bitmap_free(priv->af_xdp_zc_qps); > >- pm_runtime_disable(dev); >+ /* For PCI devices PM is disabled/enabled by the framework */ >+ if (!priv->plat->pdev) >+ pm_runtime_disable(dev); >+ > pm_runtime_put_noidle(dev); > } > EXPORT_SYMBOL_GPL(stmmac_dvr_remove); > >--- >base-commit: 23956900041d968f9ad0f30db6dede4daccd7aa9 >change-id: 20240321-stmmac-fix-f506d52882d2 > >Best regards, >-- >Mikhail Malyshev > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel