Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143248722
D53835.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D53835.diff
View Options
diff --git a/sys/dev/tpm/tpm20.h b/sys/dev/tpm/tpm20.h
--- a/sys/dev/tpm/tpm20.h
+++ b/sys/dev/tpm/tpm20.h
@@ -136,6 +136,7 @@
};
int tpm20_suspend(device_t dev);
+int tpm20_resume(device_t dev);
int tpm20_shutdown(device_t dev);
int32_t tpm20_get_timeout(uint32_t command);
int tpm20_init(struct tpm_sc *sc);
diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c
--- a/sys/dev/tpm/tpm20.c
+++ b/sys/dev/tpm/tpm20.c
@@ -242,9 +242,28 @@
destroy_dev(sc->sc_cdev);
}
+int
+tpm20_resume(device_t dev)
+{
+#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM
+ struct tpm_sc *sc;
+
+ sc = device_get_softc(dev);
+ taskqueue_enqueue_timeout(taskqueue_thread, &sc->harvest_task,
+ hz * TPM_HARVEST_INTERVAL);
+#endif
+ return (0);
+}
+
int
tpm20_suspend(device_t dev)
{
+#if defined TPM_HARVEST || defined RANDOM_ENABLE_TPM
+ struct tpm_sc *sc;
+
+ sc = device_get_softc(dev);
+ taskqueue_drain_timeout(taskqueue_thread, &sc->harvest_task);
+#endif
return (tpm20_save_state(dev, true));
}
diff --git a/sys/dev/tpm/tpm_crb.c b/sys/dev/tpm/tpm_crb.c
--- a/sys/dev/tpm/tpm_crb.c
+++ b/sys/dev/tpm/tpm_crb.c
@@ -449,6 +449,7 @@
DEVMETHOD(device_detach, tpmcrb_detach),
DEVMETHOD(device_shutdown, tpm20_shutdown),
DEVMETHOD(device_suspend, tpm20_suspend),
+ DEVMETHOD(device_resume, tpm20_resume),
DEVMETHOD(tpm_transmit, tpmcrb_transmit),
{0, 0}
};
diff --git a/sys/dev/tpm/tpm_tis_core.c b/sys/dev/tpm/tpm_tis_core.c
--- a/sys/dev/tpm/tpm_tis_core.c
+++ b/sys/dev/tpm/tpm_tis_core.c
@@ -487,6 +487,7 @@
DEVMETHOD(device_detach, tpmtis_detach),
DEVMETHOD(device_shutdown, tpm20_shutdown),
DEVMETHOD(device_suspend, tpm20_suspend),
+ DEVMETHOD(device_resume, tpm20_resume),
DEVMETHOD(tpm_transmit, tpmtis_transmit),
DEVMETHOD_END
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 29, 1:49 AM (5 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28070722
Default Alt Text
D53835.diff (1 KB)
Attached To
Mode
D53835: tpm20: Disable the entropy harvester when suspending
Attached
Detach File
Event Timeline
Log In to Comment