<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/tpm, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>tpm20: fix suspend/resume and entropy harvesting</title>
<updated>2026-04-12T13:43:44+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2026-02-05T03:35:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f329d69b9176a1d407276a010c2b87a07a2bbc5d'/>
<id>f329d69b9176a1d407276a010c2b87a07a2bbc5d</id>
<content type='text'>
There were a few problem here:
  - TPM2_Shutdown results in a response that we need to either process
    or ignore, otherwise any tpm20_write or tpm20_harvest call will
    trivially hang on an `sc-&gt;pending_data_length != 0`
  - We should have a matching TPM2_Startup upon resume to restore any
    state that should have persisted
  - We must drain the harvest task before we suspend to avoid problems
    there

This commit is sufficient to avoid breaking suspend/resume.

Co-authored-by:	markj
Tested by:	garga

(cherry picked from commit 38a4995eb52db21116f8b37ed942e66a8c2f050f)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were a few problem here:
  - TPM2_Shutdown results in a response that we need to either process
    or ignore, otherwise any tpm20_write or tpm20_harvest call will
    trivially hang on an `sc-&gt;pending_data_length != 0`
  - We should have a matching TPM2_Startup upon resume to restore any
    state that should have persisted
  - We must drain the harvest task before we suspend to avoid problems
    there

This commit is sufficient to avoid breaking suspend/resume.

Co-authored-by:	markj
Tested by:	garga

(cherry picked from commit 38a4995eb52db21116f8b37ed942e66a8c2f050f)
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm: Register TPM as entropy source</title>
<updated>2024-09-07T05:13:14+00:00</updated>
<author>
<name>Jean-François Hren</name>
<email>jean-francois.hren@stormshield.eu</email>
</author>
<published>2024-08-31T17:53:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0b683336b211e74b6d7f21ecf517c6591370b793'/>
<id>0b683336b211e74b6d7f21ecf517c6591370b793</id>
<content type='text'>
TPM is defined as an entropy and is called every 10 seconds. However it
was not registered and calls were discarded.

Signed-off-by: Jean-François Hren &lt;jean-francois.hren@stormshield.eu&gt;

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1398

(cherry picked from commit d7c87526b1c3d32d3ac3fee8c59d92405b7621b9)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TPM is defined as an entropy and is called every 10 seconds. However it
was not registered and calls were discarded.

Signed-off-by: Jean-François Hren &lt;jean-francois.hren@stormshield.eu&gt;

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1398

(cherry picked from commit d7c87526b1c3d32d3ac3fee8c59d92405b7621b9)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:11+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=95ee2897e98f5d444f26ed2334cc7c439f9c16c6'/>
<id>95ee2897e98f5d444f26ed2334cc7c439f9c16c6</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm: Fix entropy harvesting logic</title>
<updated>2022-09-02T11:09:41+00:00</updated>
<author>
<name>Kornel Dulęba</name>
<email>kd@FreeBSD.org</email>
</author>
<published>2022-09-02T11:07:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e23ad9c4ba2d2fd235fc3dc988ca422ef4e7ca3b'/>
<id>e23ad9c4ba2d2fd235fc3dc988ca422ef4e7ca3b</id>
<content type='text'>
Use a taskqueue instead of a callout.
Callout functions mustn't sleep, where as the TPM driver
uses a sx lock in order to serialize accesses to the device.
Since the entropy harvesting feature is not enabled by default,
this commit should not bring any functional changes to the GENERIC
kernel.

Approved by:	mw(mentor)
Sponsored by:	Stormshield
Obtained from:	Semihalf
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36412
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a taskqueue instead of a callout.
Callout functions mustn't sleep, where as the TPM driver
uses a sx lock in order to serialize accesses to the device.
Since the entropy harvesting feature is not enabled by default,
this commit should not bring any functional changes to the GENERIC
kernel.

Approved by:	mw(mentor)
Sponsored by:	Stormshield
Obtained from:	Semihalf
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36412
</pre>
</div>
</content>
</entry>
<entry>
<title>TPM: do not set device description if probe fails</title>
<updated>2022-08-16T09:07:12+00:00</updated>
<author>
<name>Konrad Sewiłło-Jopek</name>
<email>kjopek@gmail.com</email>
</author>
<published>2022-08-16T07:27:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=31ee3a33aa612294db302828d4d1f6f0c83bef4c'/>
<id>31ee3a33aa612294db302828d4d1f6f0c83bef4c</id>
<content type='text'>
device_set_desc should be called only if driver probes successfully.

Approved by:	mw(mentor)
Reviewed by:	mw, kd
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35998
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
device_set_desc should be called only if driver probes successfully.

Approved by:	mw(mentor)
Reviewed by:	mw, kd
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35998
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm: Remove unused devclass arguments to DRIVER_MODULE.</title>
<updated>2022-05-09T19:22:04+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2022-05-09T19:22:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f5dfa6b98901e161bb7bac46034c6955e5baa0ee'/>
<id>f5dfa6b98901e161bb7bac46034c6955e5baa0ee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm: Remove unused variables.</title>
<updated>2022-04-08T00:01:29+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2022-04-08T00:01:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=08ff11e524230bf9bf4c2adfd8f094af64c5f956'/>
<id>08ff11e524230bf9bf4c2adfd8f094af64c5f956</id>
<content type='text'>
All of the legacy config stuff in tpm seems broken.  Nothing ever sets
tpm_enabled to a non-zero value and the legacy bits expect tpm_enabled
to be set to the base IO port address (I think).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All of the legacy config stuff in tpm seems broken.  Nothing ever sets
tpm_enabled to a non-zero value and the legacy bits expect tpm_enabled
to be set to the base IO port address (I think).
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm_tis: Improve interrupt allocation</title>
<updated>2021-08-16T04:28:33+00:00</updated>
<author>
<name>Kornel Duleba</name>
<email>mindal@semihalf.com</email>
</author>
<published>2021-08-16T04:26:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=59d1661cd8b02d13bc697e9dc0ff97844e719d9b'/>
<id>59d1661cd8b02d13bc697e9dc0ff97844e719d9b</id>
<content type='text'>
Validate the irq received from ACPI. Test if it works by sending a simple command and checking if the interrupt handler was executed.
Internal buffer allocation was moved away from common code to tis and crb parts - in order to test the interrupt we need to have it allocated early.

Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D31395
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Validate the irq received from ACPI. Test if it works by sending a simple command and checking if the interrupt handler was executed.
Internal buffer allocation was moved away from common code to tis and crb parts - in order to test the interrupt we need to have it allocated early.

Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D31395
</pre>
</div>
</content>
</entry>
<entry>
<title>unifdef -D__FreeBSD__ to remove the OpenBSD support</title>
<updated>2021-01-14T06:35:22+00:00</updated>
<author>
<name>David E. O'Brien</name>
<email>obrien@FreeBSD.org</email>
</author>
<published>2021-01-14T04:45:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9a01a25516367d1deeb48484d38a66137b01ebb0'/>
<id>9a01a25516367d1deeb48484d38a66137b01ebb0</id>
<content type='text'>
OpenBSD never accepted this driver, and instead wrote their
own minimal one (sys/dev/acpi/tpm.c for suspending the device).

Reviewed by:    stevek, emaste
Differential Revision:  D10321
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenBSD never accepted this driver, and instead wrote their
own minimal one (sys/dev/acpi/tpm.c for suspending the device).

Reviewed by:    stevek, emaste
Differential Revision:  D10321
</pre>
</div>
</content>
</entry>
</feed>
