Subject: Re: [PATCH v1 net-next] lan743x: Provide Read/Write Access to on chip OTP

From: Andrew Lunn <[email-masked]>
Date: Sun, 20 Jan 2019 20:32:34 +0100

On Fri, Jan 18, 2019 at 04:54:53PM -0500, Bryan Whitehead wrote:
> The LAN743x includes on chip One-Time-Programmable (OTP) memory.
> 
> This patch extends the ethtool EEPROM read/write interface to
> access OTP memory space.
> 
> This is done by adding the private flag OTP_ACCESS, which is used
> to switch between EEPROM, and OTP modes.
> 
> The private flag OTP_ACCESS is configurable through the
>   ethtool --set-priv-flags command.
> And visible through the
>   ethtool --show-priv-flags command.

Hi Bryan

It would be good to explain what is wrong with the current code, which
allows you to select between the OTP and the EEPROM at write time.

> +static int lan743x_ethtool_set_priv_flags(struct net_device *netdev, u32 flags)
> +{
> +	struct lan743x_adapter *adapter = netdev_priv(netdev);
> +
> +	adapter->flags = flags;
> +
> +	return 0;
> +}

Is the EEPROM mandatory? Could there be designs without an EEPROM?
When setting the private flag here, should you probe to see if there
actually is an EEPROM and return -ENODEV if it is missing.

	 Andrew