mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Broadcom internal kernel review list"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Marek Behún" <kabel@kernel.org>, "Xu Liang" <lxu@maxlinear.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 0/5] net: phy: C45-over-C22 access
Date: Tue, 24 Jan 2023 15:41:56 +0100	[thread overview]
Message-ID: <dcea8c36e626dc31ee1ddd8c867eb999@walle.cc> (raw)
In-Reply-To: <Y87WR/T395hKmgKm@shell.armlinux.org.uk>

>> The problem is in the middle.  get_phy_c45_devs_in_pkg() uses
>> mdiobus_c45_read(). Does mdiobus_c45_read() mean perform a C45 bus
>> transaction, or access the C45 address space? I would say it means
>> perform a C45 bus transaction. It does not take a phydev, so we are
>> below the concept of PHYs, and so C45 over C22 does not exist at this
>> level.
> 
> C45-over-C22 is a PHY thing, it isn't generic. We shouldn't go poking
> at the PHY C45-over-C22 registers unless we know for certain that the
> C22 device we are accessing is a PHY, otherwise we could be writing
> into e.g. a switch register or something else.
> 
> So, the mdiobus_* API should be the raw bus API. If we want C45 bus
> cycles then mdiobus_c45_*() is the API that gives us that, vs C22 bus
> cycles through the non-C45 API.
> 
> C45-over-C22 being a PHY thing is something that should be handled by
> phylib, and currently is. The phylib accessors there will use C45 or
> C45-over-C22 as appropriate.

I think the crux is get_phy_device(). It is used for two different
cases:
  (1) to scan the mdio bus
  (2) to add a c45 phy, i.e. in the DT/fwnode case

For (1) we must not use indirect access. And for (2) we know for
a fact that it must be a PHY and thus we can (and have to) fall back
to c45-over-c22.

Btw. for the DT case, it seems we need yet another property
to indicate broken MDIO busses.

-michael

  parent reply	other threads:[~2023-01-24 14:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 22:40 Michael Walle
2023-01-20 22:40 ` [PATCH net-next 1/5] net: phy: add error checks in mmd_phy_indirect() and export it Michael Walle
2023-01-23 15:34   ` Andrew Lunn
2023-01-20 22:40 ` [PATCH net-next 2/5] net: phy: support indirect c45 access in get_phy_c45_ids() Michael Walle
2023-01-20 22:40 ` [PATCH net-next 3/5] net: phy: add support for C45-over-C22 transfers Michael Walle
2023-01-20 22:40 ` [PATCH net-next 4/5] phy: net: introduce phy_promote_to_c45() Michael Walle
2023-01-20 23:20   ` Russell King (Oracle)
2023-01-20 23:27     ` Michael Walle
2023-01-20 22:40 ` [PATCH net-next 5/5] net: phy: mxl-gpy: remove unneeded ops Michael Walle
2023-01-23 18:03 ` [PATCH net-next 0/5] net: phy: C45-over-C22 access Andrew Lunn
2023-01-23 18:47   ` Russell King (Oracle)
2023-01-23 20:05     ` Andrew Lunn
2023-01-24  0:35       ` Michael Walle
2023-01-24  1:44         ` Andrew Lunn
2023-01-24 14:41     ` Michael Walle [this message]
2023-01-24 21:03       ` Andrew Lunn
2023-01-24 21:20         ` Michael Walle
2023-01-25 13:52           ` Andrew Lunn

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=dcea8c36e626dc31ee1ddd8c867eb999@walle.cc \
    --to=michael@walle.cc \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lxu@maxlinear.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.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®