Re: [PATCH net-next 3/5] net: lan743x: Add support for OTP
From: Raju Lakkaraju <hidden>
Date: 2022-03-17 10:52:30
Hi Andrew The 03/15/2022 21:44, Andrew Lunn wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safequoted
+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
Accepted. Fix in V1 patches
quoted
+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.
Accepted. Fix in V1 patches
quoted
+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.
Accepted. Fix in V1 patches
Andrew
-- Thanks, Raju