All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	UNGLinuxDriver@microchip.com, Ian.Saturley@microchip.com
Subject: Re: [PATCH net-next 3/5] net: lan743x: Add support for OTP
Date: Tue, 15 Mar 2022 21:44:16 +0100	[thread overview]
Message-ID: <YjD6oGrwjgCdmUDj@lunn.ch> (raw)
In-Reply-To: <20220315061701.3006-4-Raju.Lakkaraju@microchip.com>

> +static int lan743x_hs_otp_cmd_cmplt_chk(struct lan743x_adapter *adapter)
> +{
> +	unsigned long start_time = jiffies;
> +	u32 val;
> +
> +	do {
> +		val = lan743x_csr_read(adapter, HS_OTP_STATUS);
> +		if (!(val & OTP_STATUS_BUSY_))
> +			break;
> +
> +		usleep_range(80, 100);
> +	} while (!time_after(jiffies, start_time + HZ));
> +
> +	if (val & OTP_STATUS_BUSY_) {
> +		netif_warn(adapter, drv, adapter->netdev,
> +			   "Timeout on HS_OTP_STATUS completion\n");
> +		return -ETIMEDOUT;
> +	}

iopoll.h

> +static int lan743x_hs_otp_read(struct lan743x_adapter *adapter, u32 offset,
> +			       u32 length, u8 *data)
> +{
> +	int ret;
> +	int i;
> +
> +	if (offset + length > MAX_OTP_SIZE)
> +		return -EINVAL;

The core does this.

> +static int lan743x_hs_otp_write(struct lan743x_adapter *adapter, u32 offset,
> +				u32 length, u8 *data)
> +{
> +	int ret;
> +	int i;
> +
> +	if (offset + length > MAX_OTP_SIZE)
> +		return -EINVAL;

The core does this.

    Andrew

  reply	other threads:[~2022-03-15 20:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15  6:16 [PATCH net-next 0/5] net: lan743x: PCI11010 / PCI11414 devices Enhancements Raju Lakkaraju
2022-03-15  6:16 ` [PATCH net-next 1/5] net: lan743x: Add support to display Tx Queue statistics Raju Lakkaraju
2022-03-15  6:16 ` [PATCH net-next 2/5] net: lan743x: Add support for EEPROM Raju Lakkaraju
2022-03-15 20:42   ` Andrew Lunn
2022-03-17 10:49     ` Raju Lakkaraju
2022-03-15  6:16 ` [PATCH net-next 3/5] net: lan743x: Add support for OTP Raju Lakkaraju
2022-03-15 20:44   ` Andrew Lunn [this message]
2022-03-17 10:52     ` Raju Lakkaraju
2022-03-15  6:17 ` [PATCH net-next 4/5] net: lan743x: Add support for PTP-IO Event Input External Timestamp (extts) Raju Lakkaraju
2022-03-15 10:09   ` kernel test robot
2022-03-15 10:30   ` kernel test robot
2022-03-15 20:45   ` Andrew Lunn
2022-03-17 10:53     ` Raju Lakkaraju
2022-03-15  6:17 ` [PATCH net-next 5/5] net: lan743x: Add support for PTP-IO Event Output (Periodic Output) Raju Lakkaraju

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=YjD6oGrwjgCdmUDj@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Ian.Saturley@microchip.com \
    --cc=Raju.Lakkaraju@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=kuba@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 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.