mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Switch <kyle.switch@motor-comm.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Frank.Sae@motor-comm.com, hkallweit1@gmail.com,
	linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, ming.xu@motor-comm.com,
	xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com,
	jie.han@motor-comm.com
Subject: Re: [PATCH net-next v5] net: phy: Add driver for Motorcomm Quad 2.5GbE phy
Date: Tue, 28 Jul 2026 19:25:06 +0800	[thread overview]
Message-ID: <7a0f1dba-047d-4155-a057-3ab25eb87918@motor-comm.com> (raw)
In-Reply-To: <cf87c11c-308c-4a3b-a374-6e705a3a1d57@lunn.ch>



On 7/28/26 05:36, Andrew Lunn wrote:
>>> So, please look at adding phy_package_lock() and
>>> phy_package_unlock(). Maybe it is possible to make use of struct
>>> mii_bus shared_lock? Please look at how that is currently used and
>>> check to see if there might be deadlocks.
>>>
>>
>> Ans: From my perspective, although a phy8824 has four UTPs, it uses the same mdio bus. 
>>      Wouldn't it be possible to achieve the desired effect without using an extra lock.
>>
>>      There are only two scenarios for phy8824 to swap to USXGMII reg space.
>>      1. init configuration 
>>      2. soft reset and isolate done in USXGMII side during UTP soft reset.
> 
> Soft reset is performed in phy_init_hw() which is called in a few
> different places, such as phy_attach_direct(), phy_mii_ioctl() etc. So
> you have to assume it can be called anytime. As such you need locking.
> 
> A big point of phylib is the collection of helpers to deal with
> anything defined in 802.3. The PHY driver should be using these
> helpers to do things defined in the standard. But if you are holding
> the mdio lock, you cannot use the helpers. What i don't want to see is
> your driver reimplementing code which we have in helpers because of
> your bad hardware design.
> 
> Locking is hard, and given how infrequently phylib does operations, it
> is going to be difficult to find and fix race conditions which result
> in the PHYs becoming miss configured. So you need a simple, robust
> solution.
> 
> If you think you have a solution to allow the helpers to be used,
> which is simple and robust, please post it. Otherwise, i think you
> need phy_package_lock()/phy_package_unlock()

Ans: i will post patch v7, please help comments on it.

> 
> 	Andrew

      reply	other threads:[~2026-07-28 11:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 11:48 Kyle Switch
2026-07-21 13:27 ` Andrew Lunn
2026-07-22  7:44   ` Kyle Switch
2026-07-21 14:18 ` Andrew Lunn
2026-07-22  8:06   ` Kyle Switch
2026-07-22 13:18     ` Andrew Lunn
2026-07-23  9:28       ` Kyle Switch
2026-07-23 14:27         ` Andrew Lunn
2026-07-24 11:46           ` Kyle Switch
2026-07-24 13:18             ` Andrew Lunn
2026-07-24 22:18               ` Andrew Lunn
2026-07-26  3:38                 ` Kyle Switch
2026-07-26  4:24                 ` Kyle Switch
2026-07-26  3:24               ` Kyle Switch
2026-07-26 14:51                 ` Andrew Lunn
2026-07-27  8:47                   ` Kyle Switch
2026-07-27 21:36                     ` Andrew Lunn
2026-07-28 11:25                       ` Kyle Switch [this message]

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=7a0f1dba-047d-4155-a057-3ab25eb87918@motor-comm.com \
    --to=kyle.switch@motor-comm.com \
    --cc=Frank.Sae@motor-comm.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jianmin.wang@motor-comm.com \
    --cc=jie.han@motor-comm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ming.xu@motor-comm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xiaolin.xu@motor-comm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®