Article View: linux.kernel.netdev
Article #27470Re: [PATCH v2] net/mlx5: Use generic power management
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 18:55
Date: Sat, 05 Dec 2026 18:55
118 lines
12114 bytes
12114 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The commit says it only swaps the legacy pci_driver
.suspend/.resume hooks for dev_pm_ops ("Switch to the generic power…
--
net/mlx5: Use generic power management
This moves mlx5_core off the legacy pci_driver .suspend/.resume
callbacks and onto dev_pm_ops built with DEFINE_SIMPLE_DEV_PM_OPS.
mlx5_suspend() and mlx5_resume() now take a struct device. The ops are
attached through .driver.pm with pm_sleep_ptr().
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> index 0439fcfb9ce57..faa6f16fad9b4 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
[ ... ]
> +static DEFINE_SIMPLE_DEV_PM_OPS(mlx5_pm_ops, mlx5_suspend, mlx5_resume);
> +
[ ... ]
> @@ -2286,8 +2290,7 @@ static struct pci_driver mlx5_core_driver = {
> .id_table = mlx5_core_pci_table,
> .probe = probe_one,
> .remove = remove_one,
> - .suspend = mlx5_suspend,
> - .resume = mlx5_resume,
> + .driver.pm = pm_sleep_ptr(&mlx5_pm_ops),
[Severity: Medium]
Does this conversion keep the PCI power state of the device the same
across system sleep?
With the legacy hooks, pci_has_legacy_pm_support() was true. Both
pci_pm_suspend_noirq() and pci_pm_poweroff_noirq() ended up in
pci_legacy_suspend_late():
drivers/pci/pci-driver.c:pci_legacy_suspend_late() {
if (!pci_dev->state_saved)
pci_save_state(pci_dev);
pci_pm_set_unknown_state(pci_dev);
...
}
pci_pm_set_unknown_state() only changes current_state from PCI_D0 to
PCI_UNKNOWN. Nothing is written to PMCSR, so the function stayed in D0.
With .driver.pm set, both noirq phases now go through
pci_pm_suspend_noirq_common(). mlx5_suspend() never calls
pci_save_state(), so state_saved is false and the core takes this path:
drivers/pci/pci-driver.c:pci_pm_suspend_noirq_common() {
if (!pci_dev->state_saved) {
pci_save_state(pci_dev);
...
if (!pci_dev->skip_bus_pm && pci_power_manageable(pci_dev))
pci_prepare_to_sleep(pci_dev);
}
...
}
pci_prepare_to_sleep() calls pci_set_power_state(dev, pci_target_state()).
That puts the function into D3hot, or into D3cold when the platform
controls power.
DEFINE_SIMPLE_DEV_PM_OPS also uses mlx5_suspend() as the .poweroff
callback. So the poweroff_noirq phase of hibernation now does the same
thing, which the legacy path never did.
On resume, this path now runs after a real D3->D0 transition:
mlx5_resume()
mlx5_load_one()
mlx5_load_one_devl_locked()
mlx5_function_setup()
mlx5_function_enable()
After D3cold the firmware may also have to cold boot. If it doesn't
finish within FW_PRE_INIT_TIMEOUT in wait_fw_init(), mlx5_load_one()
fails. The device is then left in MLX5_DEVICE_STATE_INTERNAL_ERROR.
Nothing under mlx5/core seems to put these functions into D3 across
system sleep today. There are no users of pci_set_power_state(), PCI_D3
or pci_choose_state() there. So this looks like a new hardware path.
Has it been tested on ConnectX/BlueField hardware for S3, s2idle and S4?
That includes multi-PF, Socket Direct and BlueField ECPF setups, where
several functions share firmware. The v2 notes only mention compile
testing.
If the move to D3 is intended, could the commit message mention it? The
commit message currently only says:
"Switch to the generic power management and remove the usage of
legacy (pci_driver) hooks."
> .shutdown = shutdown,
> .err_handler = &mlx5_err_handler,
> .sriov_configure = mlx5_core_sriov_configure,
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204185308.6819-1-vaibhavgupta40%40gmail.com
Technical Details
Message-ID:
<179649693664.3148.17485330191085387029@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!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-378094-linux-kernel-netdev=dewy.ruReferences:
<20261204185308.6819-1-vaibhavgupta40@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!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-378094-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v2] net/mlx5: Use generic power management Date: Sat, 05 Dec 2026 18:55:36 +0000 Organization: Usenet Network Message-ID: <179649693664.3148.17485330191085387029@kernel.org> References: <20261204185308.6819-1-vaibhavgupta40@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3098134"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:N7VfKS2dzckdVIcz8ulO2BDQxwA= sha256:LijKN/M9Uil9b8xlWTKDfsfG0YfqV48hP7FPajIulj0= sha1:mvSJXOHxDqKEUmAi8Cqe5XMU8D8= sha256:78kyDLhorAPowvXN5KYGNGN2SJmfJmHmUq+0mbF5I64= 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 06562117E8A; Sat, 5 Dec 2026 21:55:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.64 X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org 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 varDKZN8QqIe; Sat, 5 Dec 2026 21:55:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-378094-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 764D9117E61; Sat, 5 Dec 2026 21:55:41 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 7C25E60635B; Sat, 5 Dec 2026 18:55:40 +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=1796496939; b=nDVGtcDMbXRLE6LD/cl+OoryAIfExDA5nDQYBgPo3qAXU9rfhbiu9lOkwlG9yIGHvxPx pyS3F0CpsGAJFXDMN56mucif4qbeWtINTPXwl0x/IbnIF5bAFcr7cb7DvFk4IJWSBkKn0 FC4+p4VCvXkujSijGikgdFKzVW7aMRT4hkAJ97dVa/rsJmce5wPVfqEks5pXUAP98MJfb xKJxmJj8WjgeGsdX7pGli8aThasXt4roC8pDQ67q4Z8A6VpBe8NUXk5eqT0PhCYq+E8oi +1nRCxVtViKU1bVLsRp5D0d46y7/sy0ftaUHyRjp6IuX01+Sb5z5/FLrgYWzBAQzAUA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796496939; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=DgtjLnA2S1USZQeiop56C8gA6qwXSeZj58uKsWYows4=; b=ERnUSTxOQK25v58ivwTKu2JZWdTd06YnjqLlI+pDYJYCgd0fRiFDJwXY21sa7TIEf4q4 9IIU5WvNrAfWOFySqc9LIUvJzt7wMFWRS4uM57/K0aMEiF4q+OHsFEtmUAq2lkORHWmNA LrUPNV6JxmiRn+eMDIqbzNV4PmxW+gS9vRxNb1UCjwi+phE4qASzQvbCJe/aBOpk5uaU1 si+KKYEO0iVR0MIOy7nXIM93QeWv+CWrcWG0lC4aHa6CiZB/05t2rIHJAV9oSag+fezXW 8hDk/QC4U0xPBW4pw3E35oI5t6gNqJC1kVeaX1Zyt4ut5tAautlxXg/hOrEL6bhy9Ng== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I2p41AZf; 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 50DE2606A33B; Sat, 5 Dec 2026 18:55:39 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I2p41AZf X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796496938; b=Itf0QzOv/5c5Xf7I88pB33XVGzQVj8IEa2DQplxGocIYODSa2WXLJmPJsfPdv8XQtO+2 pB13GdoVVVKV8bPdqNae+0Zc142rXXrLqm1u1URTO+riuSbtmackC33mPj31FhrUT3pCc KagmNiJs/DA8frcnCr1mlIESMpGpqOTzOwOR4B140af/aoshZCZaYUPA6LjsY0MOcVSBl 0Mat1/jf8EQgeHWq7NGUta52F8TiyK0db0zna+BQbPK0qhYu6Fw3JvxIe3EHfBkPf1uZO /BISSL2SNs0l5anil9N768S9vcGbzzuRunSa8ni3VmttFuv2GnV1qDMfRQWL53xC3ww== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796496938; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=DgtjLnA2S1USZQeiop56C8gA6qwXSeZj58uKsWYows4=; b=DCldShcvWNHX4tU3q74a/p200wMzVdfmONXGziVz0HVEHzd1iNZENO1pQni1EFLtTcAo ovH0eVm0nLF3qPe1ftHXjiiyCDIEFcNK1wOU5tEGKWqRU9QEbzLh+MIDOmH6F3FU3CKUS mbuQB4Z2cNMnf7IX48N7hV6vJhP1BS/W2CqQPYn/zPHA4GrvA0IDb46NAOkLyYvFzU9V6 cFSTIMHIrTwccy78NKwEO1isSNsGUS8NVlkbAqNQNG3OR2+oL27WNxgxpxjlWcq/UdtNt kFPGjiteghnnOfUlTnagl5Gcq+z1yIrkA/0+fsKd2lnyzQ0XPFaH29dogzMvUAT77FA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I2p41AZf; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F7B6606A31F; Sat, 5 Dec 2026 18:55:38 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 207EC1F0092B; Sat, 5 Dec 2026 18:55:37 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796496938; bh=DgtjLnA2S1USZQeiop56C8gA6qwXSeZj58uKsWYows4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=I2p41AZfr5B1P3fb7jNDfhjP8TQDMFCOBBUTYPlj5rZMRRgNx36HT0oGW/0eUBc1U pfG7n9yCZ7A6ID3C+Ai7FbAXwKOfgxwv2odGZJ7CMXbZ+XRge63qfm6PjwgC0JRlWG BbUrz2wXrt1tTN7UgwBjGusOsNbH+j6XPONiTTQhA21uKgtdNj8TTx4AWroTKKMj/C 7DQRHCPzfQoU2H09rbd+0Tv530YNHVdqq03T+3bxH3COKG61fyiurhP1OF485M4PQL RarFe7APRVtInfE+WOz0asBsLSntUdWA9OUn9J4k8F9YYj/GbdhRWMlszvYvc8Prgq GHKrKX+UfP/VA== X-Cc: helgaas@kernel.org, bhelgaas@google.com, bjorn@helgaas.com, saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com, mbloch@nvidia.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, cjubran@nvidia.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261204185308.6819-1-vaibhavgupta40@gmail.com> X-sashiko-severity: Medium 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