<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/gpio, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>gpioc: allocate new fifo size</title>
<updated>2025-10-01T09:08:55+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>vexeduxr@FreeBSD.org</email>
</author>
<published>2025-09-30T11:55:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=80ef1216d773b09a6905dbb7cfdeac9844e2a084'/>
<id>80ef1216d773b09a6905dbb7cfdeac9844e2a084</id>
<content type='text'>
This slipped through after I resolved some merge conflicts.

Fixes:		d000adfe
MFC after:	1 day

(cherry picked from commit 2679636b4412927242e46d3806fbb58e2702eddb)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This slipped through after I resolved some merge conflicts.

Fixes:		d000adfe
MFC after:	1 day

(cherry picked from commit 2679636b4412927242e46d3806fbb58e2702eddb)
</pre>
</div>
</content>
</entry>
<entry>
<title>gpioc: fix race in ioctl(GPIOCONFIGEVENTS)</title>
<updated>2025-10-01T09:08:55+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>vexeduxr@FreeBSD.org</email>
</author>
<published>2025-09-30T11:09:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6163ced966b4e37a987e514aa2d2a61781c98fa5'/>
<id>6163ced966b4e37a987e514aa2d2a61781c98fa5</id>
<content type='text'>
A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS
closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the
priv-&gt;pins list, making it no longer empty and opening the door for
access to priv-&gt;events while we are reallocating it. Fix this by holding
priv-&gt;mtx while handling GPIOCONFIGEVENTS.

Reported by:	Qiu-ji Chen
PR:		289120
Reviewed by:	mmel
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D52783

(cherry picked from commit d000adfe41e6f2fe8f3dbe92d8fc2d34ae882086)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS
closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the
priv-&gt;pins list, making it no longer empty and opening the door for
access to priv-&gt;events while we are reallocating it. Fix this by holding
priv-&gt;mtx while handling GPIOCONFIGEVENTS.

Reported by:	Qiu-ji Chen
PR:		289120
Reviewed by:	mmel
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D52783

(cherry picked from commit d000adfe41e6f2fe8f3dbe92d8fc2d34ae882086)
</pre>
</div>
</content>
</entry>
<entry>
<title>gpioc: allocate priv-&gt;events with the correct size</title>
<updated>2025-10-01T09:08:55+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>vexeduxr@FreeBSD.org</email>
</author>
<published>2025-09-30T11:09:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=39139fec932edc313e891b0a49db61ad2c64b1fe'/>
<id>39139fec932edc313e891b0a49db61ad2c64b1fe</id>
<content type='text'>
MFC after:	1 day

(cherry picked from commit fa26e445544eb88f05779258e2ab9c96384fe74d)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 day

(cherry picked from commit fa26e445544eb88f05779258e2ab9c96384fe74d)
</pre>
</div>
</content>
</entry>
<entry>
<title>gpio: attach gpiobus when the controller is ready</title>
<updated>2025-07-07T18:51:47+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>vexeduxr@FreeBSD.org</email>
</author>
<published>2025-07-04T13:52:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cdba3a8f9fce453774833f2f1123536cd17003b8'/>
<id>cdba3a8f9fce453774833f2f1123536cd17003b8</id>
<content type='text'>
Only attach gpiobus when the controller is fully initialized. Children
of gpiobus expect this to be the case.

Reviewed by:	mmel, imp, andrew
Approved by:	imp (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D51088

(cherry picked from commit 4695e3aa7c685c092cb4b2662bee16c31be790f8)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only attach gpiobus when the controller is fully initialized. Children
of gpiobus expect this to be the case.

Reviewed by:	mmel, imp, andrew
Approved by:	imp (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D51088

(cherry picked from commit 4695e3aa7c685c092cb4b2662bee16c31be790f8)
</pre>
</div>
</content>
</entry>
<entry>
<title>gpiobus: add a gpiobus_add_bus function</title>
<updated>2025-07-07T18:48:59+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>vexeduxr@FreeBSD.org</email>
</author>
<published>2025-07-04T13:51:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c6a6b94b661378961179d832be6f1eceef91f953'/>
<id>c6a6b94b661378961179d832be6f1eceef91f953</id>
<content type='text'>
Some drivers need to postpone the attachment of gpiobus until hardware
init is done. Add a new gpiobus_add_bus function to accommodate this
case.

Suggested by:	mmel, andrew
Reviewed by:	mmel, imp, andrew
Approved by:	imp (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D51133

(cherry picked from commit 2c356c8b8f79c08d42b23a72b7a320b59d955a3f)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some drivers need to postpone the attachment of gpiobus until hardware
init is done. Add a new gpiobus_add_bus function to accommodate this
case.

Suggested by:	mmel, andrew
Reviewed by:	mmel, imp, andrew
Approved by:	imp (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D51133

(cherry picked from commit 2c356c8b8f79c08d42b23a72b7a320b59d955a3f)
</pre>
</div>
</content>
</entry>
<entry>
<title>bytgpio: expose PNP info</title>
<updated>2025-03-26T01:28:38+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>ahmadkhalifa570@gmail.com</email>
</author>
<published>2024-07-26T08:21:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7d042b0af1dc0f1c7f4979507aec9681d42ee616'/>
<id>7d042b0af1dc0f1c7f4979507aec9681d42ee616</id>
<content type='text'>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1349

(cherry picked from commit 969484b53217cee65d6802f1954f0431cbfc6b45)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1349

(cherry picked from commit 969484b53217cee65d6802f1954f0431cbfc6b45)
</pre>
</div>
</content>
</entry>
<entry>
<title>gpioaei: Add support for ACPI _EVT method</title>
<updated>2025-03-09T20:42:35+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2025-03-07T15:59:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e7d1f208fde82c85b061ce792f20a4aa178ec82f'/>
<id>e7d1f208fde82c85b061ce792f20a4aa178ec82f</id>
<content type='text'>
This method is often used to process GPIO "Power on" button press on
modern x86 laptops with S0ix sleep mode.

Tested with patch from https://reviews.freebsd.org/D26407

Sponsored by:	Future Crew LLC
MFC after:	2 month

(cherry picked from commit adc2c156acb50bac6e8ec66b72cadc8910ce4975)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This method is often used to process GPIO "Power on" button press on
modern x86 laptops with S0ix sleep mode.

Tested with patch from https://reviews.freebsd.org/D26407

Sponsored by:	Future Crew LLC
MFC after:	2 month

(cherry picked from commit adc2c156acb50bac6e8ec66b72cadc8910ce4975)
</pre>
</div>
</content>
</entry>
<entry>
<title>acpi_gpiobus: assume GPIO_PIN_INPUT for interrupt pins</title>
<updated>2025-03-09T20:42:13+00:00</updated>
<author>
<name>Ahmad Khalifa</name>
<email>ahmadkhalifa570@gmail.com</email>
</author>
<published>2025-03-07T15:59:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f05f6d93732e7d58464352e97e2dcafbab94adc4'/>
<id>f05f6d93732e7d58464352e97e2dcafbab94adc4</id>
<content type='text'>
Different drivers respond differently to having neither GPIO_PIN_INPUT
or GPIO_PIN_OUTPUT set, this stops the unpredictable results.

(cherry picked from commit 6aab381a498f1a43ba372f4ae9f57ef88b4767b5)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Different drivers respond differently to having neither GPIO_PIN_INPUT
or GPIO_PIN_OUTPUT set, this stops the unpredictable results.

(cherry picked from commit 6aab381a498f1a43ba372f4ae9f57ef88b4767b5)
</pre>
</div>
</content>
</entry>
<entry>
<title>acpi_gpiobus: Fix cleanup on set flags failure</title>
<updated>2025-02-27T15:10:09+00:00</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2024-12-09T15:14:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=32de28db2327014b320d2f3b29b5438dcdfd928c'/>
<id>32de28db2327014b320d2f3b29b5438dcdfd928c</id>
<content type='text'>
When GPIOBUS_PIN_SETFLAGS fails we called gpiobus_free_ivars to clean
up the contents of the ivar, then would free the ivar. This lead to a
use-after-free as the ivar had already been set on the child so
gpiobus_child_deleted would try to free it again.

Fix this by removing the early cleanup and letting
gpiobus_child_deleted handle it.

Fixes:	c9e880c0ceef ("gpiobus: Use a bus_child_deleted method to free ivars for children")
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47670
(cherry picked from commit bb8c68b25333638a20838500ccffee23b4291427)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When GPIOBUS_PIN_SETFLAGS fails we called gpiobus_free_ivars to clean
up the contents of the ivar, then would free the ivar. This lead to a
use-after-free as the ivar had already been set on the child so
gpiobus_child_deleted would try to free it again.

Fix this by removing the early cleanup and letting
gpiobus_child_deleted handle it.

Fixes:	c9e880c0ceef ("gpiobus: Use a bus_child_deleted method to free ivars for children")
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47670
(cherry picked from commit bb8c68b25333638a20838500ccffee23b4291427)
</pre>
</div>
</content>
</entry>
<entry>
<title>gpiobus: Add missing DEVMETHOD for bus_get_rman</title>
<updated>2025-02-27T13:09:22+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2024-02-23T00:14:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b53a0db0cb41678330685c620facb828941ed237'/>
<id>b53a0db0cb41678330685c620facb828941ed237</id>
<content type='text'>
Reported by:	andrew
Fixes:		5bda26333a8e gpiobus: Use bus_generic_rman_*
(cherry picked from commit 04eca69323111986b262eef3135d804361b60d17)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported by:	andrew
Fixes:		5bda26333a8e gpiobus: Use bus_generic_rman_*
(cherry picked from commit 04eca69323111986b262eef3135d804361b60d17)
</pre>
</div>
</content>
</entry>
</feed>
