Re: [PATCH v13 1/7] tpm: Make read{16, 32}() and write32() in tpm_tis_phy_ops optional

From
Jarkko Sakkinen <hidden>
Date
2021-08-26 15:57:36
Also in
linux-devicetree, lkml
Reply to
unknown sender, 2021-08-26
On Thu, 2021-08-26 at 14:19 +0300, amirmizi6@gmail.com wrote:
From: Amir Mizinski <redacted>

Only tpm_tis can use memory-mapped I/O, which is truly mapped into
the kernel's memory space. Therefore, using ioread16/ioread32/iowrite32
turns into a straightforward pointer dereference.
Every other driver requires more complicated operations to read more than
one byte at a time and will just fall back to read_bytes/write_bytes.
s/Every other driver/Some drivers, such as tpm_tis_spi,/g.
Therefore, move this common code out of tpm_tis_spi and into tpm_tis_core
so that it is used automatically when low-level drivers do not implement
the specialized methods.
This does not really explain why you are moving the code.

You are moving it so that you don't have to reimplement things both in
SPI and I2C drivers?

Perhaps:

"Re-implement tpm_tis_{read, write}_{16, 32}, so that they check
 if implementations for {read, write}_{16, 32} in tpm_tis_phys_ops
 exist, and if not, fallback to {read, write}_bytes()."
Co-developed-by: Alexander Steffen <redacted>
Signed-off-by: Alexander Steffen <redacted>
Signed-off-by: Amir Mizinski <redacted>
Reviewed-by: Jarkko Sakkinen <redacted>
Tested-by: Jarkko Sakkinen <redacted>
Since there's been a while, it'd be better if you dropped my tags.
I consider them as expired by now. Please do this for all patches.

/Jarkko
Thread (16 messages) 16 messages, 4 authors, last reply 2021-08-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help