Skip to content

Commit ecff681

Browse files
snitsjarkkojs
authored andcommitted
tpm: return false from tpm_amd_is_rng_defective on non-x86 platforms
tpm_amd_is_rng_defective is for dealing with an issue related to the AMD firmware TPM, so on non-x86 architectures just have it inline and return false. Cc: [email protected] # v6.3+ Reported-by: Sachin Sant <[email protected]> Reported-by: Aneesh Kumar K. V <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Fixes: f1324bb ("tpm: disable hwrng for fTPM on some AMD designs") Signed-off-by: Jerry Snitselaar <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent d559015 commit ecff681

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/char/tpm/tpm-chip.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ static int tpm_add_legacy_sysfs(struct tpm_chip *chip)
518518
* 6.x.y.z series: 6.0.18.6 +
519519
* 3.x.y.z series: 3.57.y.5 +
520520
*/
521+
#ifdef CONFIG_X86
521522
static bool tpm_amd_is_rng_defective(struct tpm_chip *chip)
522523
{
523524
u32 val1, val2;
@@ -566,6 +567,12 @@ static bool tpm_amd_is_rng_defective(struct tpm_chip *chip)
566567

567568
return true;
568569
}
570+
#else
571+
static inline bool tpm_amd_is_rng_defective(struct tpm_chip *chip)
572+
{
573+
return false;
574+
}
575+
#endif /* CONFIG_X86 */
569576

570577
static int tpm_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
571578
{

0 commit comments

Comments
 (0)