History log of /src/sys/dev/gpio/gpioc.c (Results 1 – 25 of 162)
Revision Date Author Comments
# 01dcb4e6 09-Dec-2025 John Baldwin <jhb@FreeBSD.org>

gpio_alloc_intr_resource: Pass rid by value

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D53407


# 7d6221ff 18-Oct-2025 David E. O'Brien <obrien@FreeBSD.org>

Match style in 3613896

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D53193


# 36138969 16-Oct-2025 Konstantin Belousov <kib@FreeBSD.org>

knotes: kqueue: handle copy for trivial filters

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D52045


# 2679636b 30-Sep-2025 Ahmad Khalifa <vexeduxr@FreeBSD.org>

gpioc: allocate new fifo size

This slipped through after I resolved some merge conflicts.

Fixes: d000adfe
MFC after: 1 day


# d000adfe 30-Sep-2025 Ahmad Khalifa <vexeduxr@FreeBSD.org>

gpioc: fix race in ioctl(GPIOCONFIGEVENTS)

A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS
closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the
priv->pins list, mak

gpioc: fix race in ioctl(GPIOCONFIGEVENTS)

A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS
closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the
priv->pins list, making it no longer empty and opening the door for
access to priv->events while we are reallocating it. Fix this by holding
priv->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

show more ...


# fa26e445 30-Sep-2025 Ahmad Khalifa <vexeduxr@FreeBSD.org>

gpioc: allocate priv->events with the correct size

MFC after: 1 day


# ef73953e 27-Aug-2025 Ahmad Khalifa <vexeduxr@FreeBSD.org>

gpioc: remove unnecessary bus_generic_* calls

gpioc never has any children, so there's no need to call these.

Reviewed by: jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freeb

gpioc: remove unnecessary bus_generic_* calls

gpioc never has any children, so there's no need to call these.

Reviewed by: jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D51933

show more ...


# 186100f1 27-Aug-2025 Ahmad Khalifa <vexeduxr@FreeBSD.org>

gpio: make gpioc a child of gpiobus

With gpioc being a direct child of the GPIO controller, it can't
allocate interrupts properly. It currently allocates interrupts using
it's parent dev (gpioX). Th

gpio: make gpioc a child of gpiobus

With gpioc being a direct child of the GPIO controller, it can't
allocate interrupts properly. It currently allocates interrupts using
it's parent dev (gpioX). This causes problems since the call never goes
through gpiobus. Instead, make gpioc a child of gpiobus and allocate
interrupts using our own dev. Also don't misuse pin->flags, it's not
meant to store the flags from sys/gpio.h

Reported by: Evgenii Ivanov <devivanov@proton.me>
Reviewed by: mmel
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D51932

show more ...


# 59e74fdf 27-Aug-2025 Ahmad Khalifa <vexeduxr@FreeBSD.org>

gpioc: cleanup if pin allocation fails

gpioc normally depends on gpioc_cdevpriv_dtor to call
gpioc_release_pin_intr when it's done with a pin. However, if
gpioc_allocate_pin_intr fails, the pin is n

gpioc: cleanup if pin allocation fails

gpioc normally depends on gpioc_cdevpriv_dtor to call
gpioc_release_pin_intr when it's done with a pin. However, if
gpioc_allocate_pin_intr fails, the pin is never added to the linked list
which the destructor loops over to free the pins. Make it so
gpioc_allocate_pin_intr cleans up after itself if it fails.

Reported by: Evgenii Ivanov <devivanov@proton.me>
Approved by: imp (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D51998

show more ...


# ef9ffb85 25-Nov-2024 Mark Johnston <markj@FreeBSD.org>

kern: Make fileops and filterops tables const where possible

No functional change intended.

MFC after: 1 week


# 99adbd1b 26-Sep-2024 Tom Jones <thj@FreeBSD.org>

gpioc: Fix handling of priv data during open

Fix the ordering of priv data creation with setting priv data. This
handles failure better and resolves a panic when repeatedly running
tools/tools/gpioe

gpioc: Fix handling of priv data during open

Fix the ordering of priv data creation with setting priv data. This
handles failure better and resolves a panic when repeatedly running
tools/tools/gpioevents.

Explicitly initialise more fields in priv data while we are here.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46568

show more ...


# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remov

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 6e62d9a5 14-Aug-2022 Dimitry Andric <dim@FreeBSD.org>

gpio: mark more INVARIANTS variables as __diagused

Mark another set of variables that are only used in INVARIANTS builds,
which otherwise result in set-but-not-used warnings.

Fixes: 7dc4d5118c02
M

gpio: mark more INVARIANTS variables as __diagused

Mark another set of variables that are only used in INVARIANTS builds,
which otherwise result in set-but-not-used warnings.

Fixes: 7dc4d5118c02
MFC after: 3 days

show more ...


# 7dc4d511 09-Aug-2022 Ed Maste <emaste@FreeBSD.org>

gpio: mark INVARIANTS variables as __diagused

Fixes INVARIANTS build with Clang 15, which previously failed due to
set-but-not-used variable warnings.

Reviewed by: dim
MFC after: 1 week
Sponsored b

gpio: mark INVARIANTS variables as __diagused

Fixes INVARIANTS build with Clang 15, which previously failed due to
set-but-not-used variable warnings.

Reviewed by: dim
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36097

show more ...


# d885615a 09-May-2022 John Baldwin <jhb@FreeBSD.org>

Remove unused gpioc_devclass.


# 3c6b5956 23-Mar-2021 Andriy Gapon <avg@FreeBSD.org>

gpioc_detach: fix freeing of wrong pointers

MFC after: 1 week


# f2a7b434 13-Jan-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Variable declarations are since C99 and r363250 allowed inside for-loops.
Partial revert of bafb68265672.

Suggested by: mmel@


# bafb6826 12-Jan-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for off-by-one in GPIO driver after r368585.
While at it declare the iteration variable outside the for-loop
to appease older compilers.

Sponsored by: Mellanox Technologies // NVIDIA Networking


# ff3468ac 12-Dec-2020 Ian Lepore <ian@FreeBSD.org>

Provide userland notification of gpio pin changes ("userland gpio interrupts").

This is an import of the Google Summer of Code 2018 project completed by
Christian Kramer (and, sadly, ignored by us f

Provide userland notification of gpio pin changes ("userland gpio interrupts").

This is an import of the Google Summer of Code 2018 project completed by
Christian Kramer (and, sadly, ignored by us for two years now). The goals
stated for that project were:

FreeBSD already has support for interrupts implemented in the GPIO
controller drivers of several SoCs, but there are no interfaces to take
advantage of them out of user space yet. The goal of this work is to
implement such an interface by providing descriptors which integrate
with the common I/O system calls and multiplexing mechanisms.

The initial imported code supports the following functionality:

- A kernel driver that provides an interface to the user space; the
existing gpioc(4) driver was enhanced with this functionality.
- Implement support for the most common I/O system calls / multiplexing
mechanisms:
- read() Places the pin number on which the interrupt occurred in the
buffer. Blocking and non-blocking behaviour supported.
- poll()/select()
- kqueue()
- signal driven I/O. Posting SIGIO when the O_ASYNC was set.
- Many-to-many relationship between pins and file descriptors.
- A file descriptor can monitor several GPIO pins.
- A GPIO pin can be monitored by multiple file descriptors.
- Integration with gpioctl and libgpio.

I added some fixes (mostly to locking) and feature enhancements on top of
the original gsoc code. The feature ehancements allow the user to choose
between detailed and summary event reporting. Detailed reporting provides
a record describing each pin change event. Summary reporting provides the
time of the first and last change of each pin, and a count of how many times
it changed state since the last read(2) call. Another enhancement allows
the recording of multiple state change events on multiple pins between each
call to read(2) (the original code would track only a single event at a time).

The phabricator review for these changes timed out without approval, but I
cite it below anyway, because the review contains a series of diffs that
show how I evolved the code from its original state in Christian's github
repo for the gsoc project to what is being commited here. (In effect,
the phab review extends the VC history back to the original code.)

Submitted by: Christian Kramer
Obtained from: https://github.com/ckraemer/freebsd/tree/gsoc2018
Differential Revision: https://reviews.freebsd.org/D27398

show more ...


# 7648bc9f 13-May-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @347527

Sponsored by: The FreeBSD Foundation


# 20105d31 25-Apr-2019 Ian Lepore <ian@FreeBSD.org>

Fix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins to
change, not the variable used to return the original pin state.

PR: 237378
Reported by: Mori Hiroki <yamori813@yahoo.co.jp>


# 01dcb4e6 09-Dec-2025 John Baldwin <jhb@FreeBSD.org>

gpio_alloc_intr_resource: Pass rid by value

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D53407


# 7d6221ff 18-Oct-2025 David E. O'Brien <obrien@FreeBSD.org>

Match style in 3613896

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D53193


1234567