From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E4EB606A33A for ; Fri, 4 Dec 2026 05:44:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.a=rsa-sha256 header.s=2022a header.b=OnK+oHLs Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4jggRh68Jtz2xns; Fri, 04 Dec 2026 16:44:32 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=203.29.241.158 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796363072; cv=none; b=O+QvWxiEAachfPPG1VtQc2NwKBSTWWBONMHR1k6dIZ77pBbU7faiQe/dkTfkEjTPswoVgLLmK40yy/gnBT+Xbt5rQk6YsvLh+negSSO8feVDUTfQ9JUTZPsN+twBddqi+uUeJk6vB6J1gn41aEjhKfse7u9/tI/O3f1/+2r2qEjqDzdBjVYLP79V96+sIPY24D7URwhcvI1Gc1RRTrKI8WFbUDf0IDbwvaXIi/5ZYcUYLS/qEdT2U+a8FJBdsWBeDK1mUXhgNN4xwAXhKVazU7opRTCxOUBYHdXrmjcg5pJVW4Go/OiPt3wA+s+WL9QwZTLpC4gP6Qkd5W8QGzSpNA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796363072; c=relaxed/relaxed; bh=kgrPtAfZFAOm0Lp+lESJ3JRZzUbzXB7l96G5QC0RBHI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=QDzQwNPWtigGzdEXdAizfjkbgt11nmDWsOpvY1DMiJgbKTAV7CIVEHDGn1Fu4LmlieS/dYvwLmgf2WNeP5KgNRROmn3CwKQTwsbIX44bxRDX/KAG6Z2craTe+1GpD3fXpldgD4rYhAXeAIZi9q8jPA+P0vFNYDRUs5CSLyu5G1Ohviw1J1mMN14fokJUK+3Lgi6KM3uIMfX33lDEmUbFBkI8mZJXzlNUhZufGam3WTr/9vzaGuIur/63KXtkHAWCyBrhvjDGV7jZ4DDnfziEGdfisf8AzgbSfNOUMwD52J703b3N6giB6VKAhahuTAazw9iLV4FvHZZIundvX9hccw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=codeconstruct.com.au; dkim=pass (2048-bit key; unprotected) header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.a=rsa-sha256 header.s=2022a header.b=OnK+oHLs; dkim-atps=neutral; spf=pass (client-ip=203.29.241.158; helo=codeconstruct.com.au; envelope-from=andrew@codeconstruct.com.au; receiver=lists.ozlabs.org) smtp.mailfrom=codeconstruct.com.au Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=codeconstruct.com.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.a=rsa-sha256 header.s=2022a header.b=OnK+oHLs; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=codeconstruct.com.au (client-ip=203.29.241.158; helo=codeconstruct.com.au; envelope-from=andrew@codeconstruct.com.au; receiver=lists.ozlabs.org) Received: from codeconstruct.com.au (pi.codeconstruct.com.au [203.29.241.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4jggRg36Hgz2xmV for ; Fri, 04 Dec 2026 16:44:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeconstruct.com.au; s=2022a; t=1796363069; bh=kgrPtAfZFAOm0Lp+lESJ3JRZzUbzXB7l96G5QC0RBHI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=OnK+oHLss6FQ65t6ABSIZfXLNeBdNXxJTcQvtIrvupvVqQhTn4Zdi/nPG3XkiyRSn bjfuD8L1wxYBYZkPz9HyZBulA+722v05Q+hJo4NTnI3jatVddXt1UlQKUVGIp8Jt6X vo+cUZSvjr+H439ZYYZn8Y4VsRSj9Eoy0PZJsCQGCxuwOnurdwljV05Ux0XoNMKIkg 1r5zda6gMzrxuJfFQNNqbfg3TbLMKn8sFpxqGpPsBKi/4wjzAcgz3TYN5kNN9RfAZ3 wmPi+MLHiOY8kiT5pg1uyL7gwmCu1p6zegOfGFtiWEmMYgmsMAjOll8eCoX5DB0vQB tYZaE6qbJxJVw== Received: from [192.168.68.117] (unknown [180.150.112.139]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id 104AB60016; Fri, 4 Dec 2026 13:44:27 +0800 (AWST) Message-ID: Subject: Re: [PATCH v4 2/2] nvmem: aspeed: Add read-only AST2600 OTP support From: Andrew Jeffery To: Prasanth Cc: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Joel Stanley , Ryan Chen , Billy Tsai , Neal Liu , Tan Siewert , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Fri, 04 Dec 2026 16:14:26 +1030 In-Reply-To: References: <20261127025817.20090-1-prasanth.padarthi10@gmail.com> <20261127025817.20090-3-prasanth.padarthi10@gmail.com> <9c7e2c877422850b71221efc3c1316157e563a90.camel@codeconstruct.com.au> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-0+deb13u1 X-Mailing-List: linux-aspeed@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , Precedence: list X-Archived-By: MIME-Version: 1.0 X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Prasanth, On Fri, 2026-12-04 at 07:21 +0530, Prasanth wrote: > Hi Andrew, >=20 > Thanks for the detailed review. I=E2=80=99ll address these points in the = next revision. > - fix the continuation indentation and unwrap the short bounds check. > - use readl_poll_timeout() for idle polling. The 1 =C2=B5s delay will > remain only after issuing an OTP command, as required by ASPEED=E2=80=99s > clarification. > - reject odd addresses in the internal pair-read helper. Public reads > may still begin at an odd word by selecting the containing even pair. > - move offset and length validation into the helper that performs the > arithmetic and copying, while preserving zero-length success and > overflow-safe bounds checks. > - ensure the failure latch is checked before any further controller > operation. Probe already stops after the first initialization failure > and only performs relock cleanup. > - consider the mutex annotations and context-analysis support for > state protected by the mutex. > - inline the single-use initialization helper if that makes the flow clea= rer. > - use devm_kzalloc_obj() if there is no compatibility concern with the > supported kernel baseline. >=20 > The probe-time NVMEM keepout covers the fixed CONF0 range. Neal > confirmed that SEC54 can increase until an ARM reset, including while > Linux is running, >=20 Sure, but what actually increases it? Nothing I saw in the driver does so. > and recommended checking it on each read. > https://lore.kernel.org/linux-aspeed/KL1PR0601MB3986A356BD06F98D0FF9AD5E8= 0792@KL1PR0601MB3986.apcprd06.prod.outlook.com/ I don't think we should be accounting for it changing outside of the driver's control. > If SEC54 grows after probe and a request falls within the newly > protected range, would you prefer the driver to return -EACCES before > issuing the read, or rely on the controller=E2=80=99s response? If we can't rely on the controller's response here I wonder how we rely on the controller at all? Can you describe its behaviour when you try accessing the secure region? Andrew