linux/drivers
Thadeu Lima de Souza Cascardo 17d253af4c tpm: do not start chip while suspended
Checking TPM_CHIP_FLAG_SUSPENDED after the call to tpm_find_get_ops() can
lead to a spurious tpm_chip_start() call:

[35985.503771] i2c i2c-1: Transfer while suspended
[35985.503796] WARNING: CPU: 0 PID: 74 at drivers/i2c/i2c-core.h:56 __i2c_transfer+0xbe/0x810
[35985.503802] Modules linked in:
[35985.503808] CPU: 0 UID: 0 PID: 74 Comm: hwrng Tainted: G        W          6.13.0-next-20250203-00005-gfa0cb5642941 #19 9c3d7f78192f2d38e32010ac9c90fdc71109ef6f
[35985.503814] Tainted: [W]=WARN
[35985.503817] Hardware name: Google Morphius/Morphius, BIOS Google_Morphius.13434.858.0 10/26/2023
[35985.503819] RIP: 0010:__i2c_transfer+0xbe/0x810
[35985.503825] Code: 30 01 00 00 4c 89 f7 e8 40 fe d8 ff 48 8b 93 80 01 00 00 48 85 d2 75 03 49 8b 16 48 c7 c7 0a fb 7c a7 48 89 c6 e8 32 ad b0 fe <0f> 0b b8 94 ff ff ff e9 33 04 00 00 be 02 00 00 00 83 fd 02 0f 5
[35985.503828] RSP: 0018:ffffa106c0333d30 EFLAGS: 00010246
[35985.503833] RAX: 074ba64aa20f7000 RBX: ffff8aa4c1167120 RCX: 0000000000000000
[35985.503836] RDX: 0000000000000000 RSI: ffffffffa77ab0e4 RDI: 0000000000000001
[35985.503838] RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
[35985.503841] R10: 0000000000000004 R11: 00000001000313d5 R12: ffff8aa4c10f1820
[35985.503843] R13: ffff8aa4c0e243c0 R14: ffff8aa4c1167250 R15: ffff8aa4c1167120
[35985.503846] FS:  0000000000000000(0000) GS:ffff8aa4eae00000(0000) knlGS:0000000000000000
[35985.503849] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[35985.503852] CR2: 00007fab0aaf1000 CR3: 0000000105328000 CR4: 00000000003506f0
[35985.503855] Call Trace:
[35985.503859]  <TASK>
[35985.503863]  ? __warn+0xd4/0x260
[35985.503868]  ? __i2c_transfer+0xbe/0x810
[35985.503874]  ? report_bug+0xf3/0x210
[35985.503882]  ? handle_bug+0x63/0xb0
[35985.503887]  ? exc_invalid_op+0x16/0x50
[35985.503892]  ? asm_exc_invalid_op+0x16/0x20
[35985.503904]  ? __i2c_transfer+0xbe/0x810
[35985.503913]  tpm_cr50_i2c_transfer_message+0x24/0xf0
[35985.503920]  tpm_cr50_i2c_read+0x8e/0x120
[35985.503928]  tpm_cr50_request_locality+0x75/0x170
[35985.503935]  tpm_chip_start+0x116/0x160
[35985.503942]  tpm_try_get_ops+0x57/0x90
[35985.503948]  tpm_find_get_ops+0x26/0xd0
[35985.503955]  tpm_get_random+0x2d/0x80

Don't move forward with tpm_chip_start() inside tpm_try_get_ops(), unless
TPM_CHIP_FLAG_SUSPENDED is not set. tpm_find_get_ops() will return NULL in
such a failure case.

Fixes: 9265fed6db ("tpm: Lock TPM chip in tpm_pm_suspend() first")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Cc: stable@vger.kernel.org
Cc: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: Mike Seo <mikeseohyungjin@gmail.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2025-03-27 15:34:04 +02:00
..
accel A sched fence reference leak fix, two fence fixes for v3d, two overflow 2025-03-21 10:41:51 +10:00
accessibility
acpi Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
amba iommu: Get DT/ACPI parsing into the proper probe path 2025-03-11 14:05:43 +01:00
android binderfs: fix use-after-free in binder_devices 2025-02-20 15:20:11 +01:00
ata ata changes for 6.15 2025-03-26 19:49:02 -07:00
atm
auxdisplay auxdisplay: hd44780: Rename hd to hdc in hd44780_common_alloc() 2025-03-10 18:03:02 +02:00
base IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
bcma
block for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
bluetooth Bluetooth: btnxpuart: Fix kernel panic during FW release 2025-03-25 15:22:17 -04:00
bus Merge branches 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'rockchip', 's390', 'core', 'intel/vt-d' and 'amd/amd-vi' into next 2025-03-20 09:11:09 +01:00
cache
cdrom treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
cdx Merge branches 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'rockchip', 's390', 'core', 'intel/vt-d' and 'amd/amd-vi' into next 2025-03-20 09:11:09 +01:00
char tpm: do not start chip while suspended 2025-03-27 15:34:04 +02:00
clk Samsung clock controller fixes for v6.14 2025-03-11 10:51:13 -07:00
clocksource Updates for clocksource/event drivers: 2025-03-26 13:30:27 -07:00
comedi
connector
counter
cpufreq Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
cpuidle pmdomain core: 2025-03-25 20:40:51 -07:00
crypto CRC updates for 6.15 2025-03-25 18:33:04 -07:00
cxl cxl changes for v6.14 2025-01-29 11:23:22 -08:00
dax
dca
devfreq PM / devfreq: rockchip-dfi: Switch to use hrtimer_setup() 2025-02-18 10:32:34 +01:00
dio
dma dmaengine fixes for v6.14 2025-03-02 10:08:45 -08:00
dma-buf
dpll Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-20 21:38:01 +01:00
edac - Add infrastructure support to EDAC in order to be able to register memory 2025-03-25 14:00:26 -07:00
eisa
extcon Update extcon next for v6.14 2025-01-12 13:44:27 +01:00
firewire Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
firmware sound updates for 6.15-rc1 2025-03-26 09:41:55 -07:00
fpga FPGA Manager changes for 6.14-rc1 2025-01-09 10:56:57 +01:00
fsi
gnss
gpio Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
gpu A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
greybus
hid Merge branch 'for-6.15/wacom' into for-linus 2025-03-26 13:56:38 +01:00
hsi
hte
hv hyperv-next for 6.15 2025-03-25 14:47:04 -07:00
hwmon platform-drivers-x86 for v6.15-1 2025-03-26 09:54:40 -07:00
hwspinlock
hwtracing ARM: 2025-03-25 14:22:07 -07:00
i2c A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
i3c I3C for 6.14 2025-01-24 15:48:01 -08:00
idle Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
iio regulator: Updates for v6.15 2025-03-25 19:04:20 -07:00
infiniband Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
input Input updates for v6.14-rc6 2025-03-15 15:46:29 -10:00
interconnect interconnect changes for 6.14 2025-01-16 14:01:40 +01:00
iommu IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
ipack
irqchip IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
isdn
leds gpio updates for v6.15-rc1 2025-03-25 20:05:43 -07:00
macintosh The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
mailbox mailbox: Switch to use hrtimer_setup() 2025-02-18 11:19:04 +01:00
mcb
md for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
media [GIT PULL for v6.15] media updates 2025-03-25 21:00:31 -07:00
memory memory: omap-gpmc: drop no compatible check 2025-03-14 17:59:17 +01:00
memstick for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
message SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
mfd PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally 2025-02-19 13:22:12 +01:00
misc A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
mmc for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
most
mtd for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
mux mux: gpio: use gpiod_multi_set_value_cansleep 2025-02-17 14:27:34 +01:00
net Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
nfc nfc: mrvl: Don't use "proxy" headers 2025-01-18 17:10:05 -08:00
ntb A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
nubus
nvdimm badblocks: use sector_t instead of int to avoid truncation of badblocks length 2025-03-06 08:04:52 -07:00
nvme for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
nvmem net, treewide: define and use MAC_ADDR_STR_LEN 2025-03-19 19:17:58 +01:00
of Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
opp Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
parisc
parport
pci IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
pcmcia
peci
perf lsm/stable-6.15 PR 20250323 2025-03-25 15:44:19 -07:00
phy Linux 6.14-rc5 2025-03-03 09:32:11 +01:00
pinctrl pinctrl: spacemit: PINCTRL_SPACEMIT_K1 should not default to y unconditionally 2025-03-18 14:11:46 +01:00
platform platform-drivers-x86 for v6.15-1 2025-03-26 09:54:40 -07:00
pmdomain pmdomain: arm: scmi_pm_domain: Remove redundant state verification 2025-03-17 11:12:01 +01:00
pnp PNP: Remove prehistoric deadcode 2025-03-12 20:37:56 +01:00
power A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
powercap Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
pps pps: generators: pps_gen_parport: Switch to use hrtimer_setup() 2025-02-18 11:19:03 +01:00
ps3
ptp ptp: ocp: reject unsupported periodic output flags 2025-03-20 08:50:03 +01:00
pwm pwm: stmpe: Allow to compile as a module 2025-03-03 10:38:54 +01:00
rapidio rapidio: add check for rio_add_net() in rio_scan_alloc_net() 2025-03-05 21:36:19 -08:00
ras x86/amd_nb: Move SMN access code to a new amd_node driver 2025-01-08 10:59:44 +01:00
regulator regulator: Updates for v6.15 2025-03-25 19:04:20 -07:00
remoteproc remoteproc: st: Use syscon_regmap_lookup_by_phandle_args 2025-01-15 10:04:27 -07:00
reset reset: mchp: sparx5: Fix for lan966x 2025-03-13 09:40:26 +01:00
rpmsg
rtc rtc: class: Switch to use hrtimer_setup() 2025-02-18 11:19:03 +01:00
s390 Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
sbus
scsi SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
sh
siox
slimbus slimbus: messaging: Free transaction ID in delayed interrupt scenario 2025-02-20 15:19:51 +01:00
soc Updates for MSI interrupts 2025-03-25 09:15:17 -07:00
soundwire soundwire: qcom: Add set_channel_map api support 2025-02-06 11:49:22 +00:00
spi spi: Updates for v6.15 2025-03-25 19:28:14 -07:00
spmi spmi: hisi-spmi-controller: Drop duplicated OF node assignment in spmi_controller_probe() 2025-01-17 12:58:49 +01:00
ssb
staging [GIT PULL for v6.15] media updates 2025-03-25 21:00:31 -07:00
target SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
tc
tee tee: optee: Fix supplicant wait loop 2025-02-14 15:17:34 +01:00
thermal Thermal control updates for 6.15-rc1 2025-03-25 15:13:31 -07:00
thunderbolt CRC updates for 6.15 2025-03-25 18:33:04 -07:00
tty serial: xilinx_uartps: Use helper function hrtimer_update_function() 2025-02-18 17:41:35 +01:00
ufs SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
uio Char/Misc/IIO driver updates for 6.14-rc1 2025-01-27 16:51:51 -08:00
usb SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
vdpa virtio: features, fixes, cleanups 2025-01-27 15:26:06 -08:00
vfio make use of anon_inode_getfile_fmode() 2025-02-21 10:25:31 +01:00
vhost vhost: return task creation error instead of NULL 2025-03-01 02:52:52 -05:00
video fbdev: hyperv_fb: Allow graceful removal of framebuffer 2025-03-09 23:56:29 +00:00
virt Linux 6.14-rc7 2025-03-19 11:03:06 +01:00
virtio virtio: mem: Switch to use hrtimer_setup() 2025-02-18 11:19:07 +01:00
w1 1-Wire bus drivers for v6.14 2025-01-09 10:54:19 +01:00
watchdog watchdog: Switch to use hrtimer_setup() 2025-02-18 10:32:33 +01:00
xen xen/pci: Do not register devices with segments >= 0x10000 2025-03-21 08:15:26 +01:00
zorro zorro: Constify 'struct bin_attribute' 2025-01-08 18:04:36 +01:00
Kconfig
Makefile