Re: [PATCH v3] tpm: loongson: reject an undersized DMA window
From: Fang Xieyan
Date: Wed Dec 02 2026 - 21:24:16 EST
Hi Qunqin,
The automated review raised a coupling concern: if TPM_BUFSIZE is ever
raised above the hardware's per-engine window size (currently 4096 for
dmam_size = 64 KiB / 16), the probe check would reject working hardware.
Two possible directions:
A) Keep the probe-time rejection as-is (v3). Simple, and correct as
long as buffer_size >= TPM_BUFSIZE holds on all supported platforms.
B) Move the buffer_size bound to recv-time instead, so the driver
adapts to whatever window the firmware provides without coupling
to TPM_BUFSIZE:
if (data_len > tpm_engine->buffer_size)
return -EIO;
Probe stays unconditional.
Do you have a preference? Happy to send v4 either way.