Re: [PATCH] crypto: atmel-sha204a - Fix OTP sysfs read and error handling
From: Thorsten Blum
Date: Sun Feb 15 2026 - 16:49:06 EST
On 15. Feb 2026, at 22:09, Lothar Rubusch wrote:
> I tried to verify your patch on hardware today, unfortunately it did
> not work for me.
>
> My setup works with current atsha204a module in the below described way. When
> trying to dump the OTP zone on exactly the same hardware with a patched module,
> it only prints '0' and nothing more, see below.
>
> [...]
Hi Lothar,
thank you for your feedback. I made a small mistake in the return value
where I forgot to add the previous length 'len'. Sorry about that!
Unfortunately, I don't have the hardware right now to test this - could
you try if it works with the following change?
Thanks,
Thorsten
diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c
index 793c8d739a0a..431672517dba 100644
--- a/drivers/crypto/atmel-sha204a.c
+++ b/drivers/crypto/atmel-sha204a.c
@@ -134,7 +134,7 @@ static ssize_t otp_show(struct device *dev,
for (i = 0; i < OTP_ZONE_SIZE; i++)
len += sysfs_emit_at(buf, len, "%02X", otp[i]);
- return sysfs_emit_at(buf, len, "\n");
+ return len + sysfs_emit_at(buf, len, "\n");
}
static DEVICE_ATTR_RO(otp);