lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Mar 2022 21:44:16 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        UNGLinuxDriver@...rochip.com, Ian.Saturley@...rochip.com
Subject: Re: [PATCH net-next 3/5] net: lan743x: Add support for OTP

> +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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ