All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Troy Mitchell" <troy.mitchell@linux.spacemit.com>
To: "Vadim Fedorenko" <vadim.fedorenko@linux.dev>
Cc: "Breno Leitao" <leitao@debian.org>,
	"Ali Tariq" <alitariq45892@gmail.com>, <netdev@vger.kernel.org>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>, "Yixun Lan" <dlan@kernel.org>,
	"Troy Mitchell" <troy.mitchell@linux.spacemit.com>,
	"Vivian Wang" <wangruikang@iscas.ac.cn>,
	"Chukun Pan" <amadeus@jmu.edu.cn>,
	"Siddharth Vadapalli" <s-vadapalli@ti.com>,
	"Tomas Hlavacek" <tmshlvck@gmail.com>,
	"Muhammad Bilal" <meatuni001@gmail.com>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	<linux-riscv@lists.infradead.org>, <spacemit@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: spacemit: Hold RTNL lock in emac_resume() and emac_suspend()
Date: Fri, 06 Nov 2026 09:41:31 +0000	[thread overview]
Message-ID: <DMO12HWY5N64.2IJ5XMUKM8WWR@linux.spacemit.com> (raw)
In-Reply-To: <6c36ec6d-5bc8-4ac3-8ad0-79eac7873b67@linux.dev>

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

On Thu, 5 Nov 2026 23:28:31 +0100, Vadim Fedorenko wrote:
> > This would work, but I am wondering if it would be possible to call
> > rtnl inside the _open function, when dealing with the PHY? in other
> > words, shrink the time rtnl is held.
>
> +1, especially in emac_open() rtnl is needed only in error path case

emac_open() and emac_stop() are also the driver's .ndo_open and
.ndo_stop, which the core already calls with RTNL held, see
Documentation/networking/netdevices.rst +214. Taking rtnl_lock()
inside them would deadlock on every open and close, so the lock has to
stay in the PM callbacks.

-- 
Troy Mitchell

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Troy Mitchell" <troy.mitchell@linux.spacemit.com>
To: "Vadim Fedorenko" <vadim.fedorenko@linux.dev>
Cc: "Breno Leitao" <leitao@debian.org>,
	"Ali Tariq" <alitariq45892@gmail.com>, <netdev@vger.kernel.org>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>, "Yixun Lan" <dlan@kernel.org>,
	"Troy Mitchell" <troy.mitchell@linux.spacemit.com>,
	"Vivian Wang" <wangruikang@iscas.ac.cn>,
	"Chukun Pan" <amadeus@jmu.edu.cn>,
	"Siddharth Vadapalli" <s-vadapalli@ti.com>,
	"Tomas Hlavacek" <tmshlvck@gmail.com>,
	"Muhammad Bilal" <meatuni001@gmail.com>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	<linux-riscv@lists.infradead.org>, <spacemit@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: spacemit: Hold RTNL lock in emac_resume() and emac_suspend()
Date: Fri, 06 Nov 2026 09:41:31 +0000	[thread overview]
Message-ID: <DMO12HWY5N64.2IJ5XMUKM8WWR@linux.spacemit.com> (raw)
In-Reply-To: <6c36ec6d-5bc8-4ac3-8ad0-79eac7873b67@linux.dev>


[-- Attachment #1.1: Type: text/plain, Size: 637 bytes --]

On Thu, 5 Nov 2026 23:28:31 +0100, Vadim Fedorenko wrote:
> > This would work, but I am wondering if it would be possible to call
> > rtnl inside the _open function, when dealing with the PHY? in other
> > words, shrink the time rtnl is held.
>
> +1, especially in emac_open() rtnl is needed only in error path case

emac_open() and emac_stop() are also the driver's .ndo_open and
.ndo_stop, which the core already calls with RTNL held, see
Documentation/networking/netdevices.rst +214. Taking rtnl_lock()
inside them would deadlock on every open and close, so the lock has to
stay in the PM callbacks.

-- 
Troy Mitchell

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2026-11-06  9:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 12:34 [PATCH net] net: spacemit: Hold RTNL lock in emac_resume() and emac_suspend() Ali Tariq
2026-11-05 12:34 ` Ali Tariq
2026-11-05 13:40 ` Breno Leitao
2026-11-05 13:40   ` Breno Leitao
2026-11-05 22:28   ` Vadim Fedorenko
2026-11-05 22:28     ` Vadim Fedorenko
2026-11-06  9:41     ` Troy Mitchell [this message]
2026-11-06  9:41       ` Troy Mitchell
2026-11-06 11:54       ` Breno Leitao
2026-11-06 11:54         ` Breno Leitao
2026-11-06 14:28         ` Troy Mitchell
2026-11-06 14:28           ` Troy Mitchell
2026-11-06  9:43 ` Troy Mitchell
2026-11-06  9:43   ` Troy Mitchell
2026-11-06 10:44   ` Ali Tariq
2026-11-06 10:44     ` Ali Tariq
2026-11-06 14:26     ` Troy Mitchell
2026-11-06 14:26       ` Troy Mitchell
2026-11-07 17:32     ` Andrew Lunn
2026-11-07 17:32       ` Andrew Lunn
2026-11-08  7:19       ` Troy Mitchell
2026-11-08  7:19         ` Troy Mitchell
2026-11-09  7:59         ` Vivian Wang
2026-11-09  7:59           ` Vivian Wang
2026-11-09  8:10           ` Troy Mitchell
2026-11-09  8:10             ` Troy Mitchell
2026-11-12 13:33             ` Ali Tariq
2026-11-12 13:33               ` Ali Tariq
2026-11-12 14:48               ` Troy Mitchell
2026-11-12 14:48                 ` Troy Mitchell
2026-11-09 12:50 ` netdev-bot+sashiko
2026-11-09 12:50   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DMO12HWY5N64.2IJ5XMUKM8WWR@linux.spacemit.com \
    --to=troy.mitchell@linux.spacemit.com \
    --cc=alitariq45892@gmail.com \
    --cc=amadeus@jmu.edu.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dlan@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=meatuni001@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=s-vadapalli@ti.com \
    --cc=spacemit@lists.linux.dev \
    --cc=tmshlvck@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=wangruikang@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.