mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next 5/6] net: dsa: mv88e6xxx: describe PHY page and SerDes
Date: Tue, 16 Aug 2016 10:57:56 -0400	[thread overview]
Message-ID: <874m6kzrpn.fsf@ketchup.mtl.sfl> (raw)
In-Reply-To: <20160816011618.GL24664@lunn.ch>

Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

> On Mon, Aug 15, 2016 at 05:19:01PM -0400, Vivien Didelot wrote:
>> +static int mv88e6xxx_phy_page_read(struct mv88e6xxx_chip *chip, int phy,
>> +				   u8 page, int reg, u16 *val)
>> +{
>> +	int err;
>> +
>> +	/* There is no paging for registers 22 */
>> +	if (reg == PHY_PAGE)
>> +		return -EINVAL;
>
> This whole paging scheme only works for internal PHYs, or external
> PHYs which happen to be Marvell PHYs. We need to be a little bit
> careful here and ensure these functions don't get used for external
> PHYs when we don't know who manufactured them. 
>
> At the moment the code is O.K, we only access SERDES or temperature
> sensors for a given port. But i wounder if adding a comment would be
> wise?

That is a good point, I thought about that too. I was thinking about
adding an internal_phys bitmask to the chip info structures and check it
in mv88e6xxx_phy_page_get(), so we could return -EINVAL for external
PHYs, since the switch driver isn't supposed to access their pages.

But I also think that most of the PHY code should be moved to a proper
PHY driver, since they are valid Marvell chips with their own PHY IDs.

Until we move the PHY and SERDES code out of the mv88e6xxx driver, I
think we are safe.

Thanks,

        Vivien

  reply	other threads:[~2016-08-16 14:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 21:18 [PATCH net-next 0/6] net: dsa: abstract PHY accesses Vivien Didelot
2016-08-15 21:18 ` [PATCH net-next 1/6] net: dsa: mv88e6xxx: rename _mv88e6xxx_wait Vivien Didelot
2016-08-15 21:18 ` [PATCH net-next 2/6] net: dsa: mv88e6xxx: describe Multi-chip registers Vivien Didelot
2016-08-15 21:18 ` [PATCH net-next 3/6] net: dsa: mv88e6xxx: rework Global2 SMI PHY access Vivien Didelot
2016-08-15 21:19 ` [PATCH net-next 4/6] net: dsa: mv88e6xxx: abstract PHY ops Vivien Didelot
2016-08-15 21:19 ` [PATCH net-next 5/6] net: dsa: mv88e6xxx: describe PHY page and SerDes Vivien Didelot
2016-08-16  1:16   ` Andrew Lunn
2016-08-16 14:57     ` Vivien Didelot [this message]
2016-08-15 21:19 ` [PATCH net-next 6/6] net: dsa: mv88e6xxx: use the new PHY API Vivien Didelot
2016-08-15 23:44 ` [PATCH net-next 0/6] net: dsa: abstract PHY accesses David Miller

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=874m6kzrpn.fsf@ketchup.mtl.sfl \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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®