Skip to content

Commit 7187bf7

Browse files
diandersJarkko Sakkinen
authored andcommitted
tpm_tis_spi: Prefer async probe
On a Chromebook I'm working on I noticed a big (~1 second) delay during bootup where nothing was happening. Right around this big delay there were messages about the TPM: [ 2.311352] tpm_tis_spi spi0.0: TPM ready IRQ confirmed on attempt 2 [ 3.332790] tpm_tis_spi spi0.0: Cr50 firmware version: ... I put a few printouts in and saw that tpm_tis_spi_init() (specifically tpm_chip_register() in that function) was taking the lion's share of this time, though ~115 ms of the time was in cr50_print_fw_version(). Let's make a one-line change to prefer async probe for tpm_tis_spi. There's no reason we need to block other drivers from probing while we load. NOTES: * It's possible that other hardware runs through the init sequence faster than Cr50 and this isn't such a big problem for them. However, even if they are faster they are still doing _some_ transfers over a SPI bus so this should benefit everyone even if to a lesser extent. * It's possible that there are extra delays in the code that could be optimized out. I didn't dig since once I enabled async probe they no longer impacted me. Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 72d0556 commit 7187bf7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/char/tpm/tpm_tis_spi_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ static struct spi_driver tpm_tis_spi_driver = {
287287
.pm = &tpm_tis_pm,
288288
.of_match_table = of_match_ptr(of_tis_spi_match),
289289
.acpi_match_table = ACPI_PTR(acpi_tis_spi_match),
290+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
290291
},
291292
.probe = tpm_tis_spi_driver_probe,
292293
.remove = tpm_tis_spi_remove,

0 commit comments

Comments
 (0)