History log of /netbsd-current/sys/dev/i2c/ihidev.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.6 14-Jan-2022 riastradh

ihidev(4): Fix locking and interrupt handler.

- Can't run iic_exec in softint because it does cv_wait, at least on
some i2c controllers -- defer to workqueue instead.

- Fix violations of locking rules:
. Do not take a lock at higher IPL than it is defined at!
. Do not sleep under a lock!
. Definitely do not sleep under a spin lock!
In this case, sc_intr_lock was defined at IPL_VM but used at IPL_TTY,
and i2c transactions -- possibly causing sleep for cv_wait -- were
issued under it.

But in this case, the interrupt handler needs only a single bit to
mark whether the work is pending, so just use atomic_swap for that.

- Use an adaptive lock (IPL_NONE) for i2c transactions.

- Detach children, and do so before freeing anything.


# 1.5 14-Jan-2022 riastradh

ihidev(4): Add missing includes and header guard.

Mark the sections that are conventionally separate files for hardware
interface (*reg.h) versus software state (*var.h).


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.4 09-Jan-2020 thorpej

branches: 1.4.10; 1.4.20;
Re-enable the intr / mask / softint / unmask dance now that the x86
interrupt issue is fixed. Verified working by ryoon@ (thanks!).


Revision tags: ad-namecache-base
# 1.3 25-Dec-2019 thorpej

branches: 1.3.2;
Revert previous until issues can be sorted out.


# 1.2 22-Dec-2019 thorpej

The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts. However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the device in order to clear
the interrupt condition.

Address this by using acpi_intr_mask() to mask off the interrupt source
while a softint is pending to service the events, re-enabling it once
servicing is completed.

While here, re-factor the interrupt setup / tear-down code a bit to
eventually once day simplify supporting the FDT bindings for hid-over-i2c.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.1 10-Dec-2017 bouyer

branches: 1.1.4;
Add drivers for HID over I2C devices, and a driver for I2C mices.
From OpenBSD.


# 1.4 09-Jan-2020 thorpej

Re-enable the intr / mask / softint / unmask dance now that the x86
interrupt issue is fixed. Verified working by ryoon@ (thanks!).


Revision tags: ad-namecache-base
# 1.3 25-Dec-2019 thorpej

Revert previous until issues can be sorted out.


# 1.2 22-Dec-2019 thorpej

The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts. However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the device in order to clear
the interrupt condition.

Address this by using acpi_intr_mask() to mask off the interrupt source
while a softint is pending to service the events, re-enabling it once
servicing is completed.

While here, re-factor the interrupt setup / tear-down code a bit to
eventually once day simplify supporting the FDT bindings for hid-over-i2c.


Revision tags: netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.1 10-Dec-2017 bouyer

Add drivers for HID over I2C devices, and a driver for I2C mices.
From OpenBSD.


# 1.3 25-Dec-2019 thorpej

Revert previous until issues can be sorted out.


# 1.2 22-Dec-2019 thorpej

The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts. However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the device in order to clear
the interrupt condition.

Address this by using acpi_intr_mask() to mask off the interrupt source
while a softint is pending to service the events, re-enabling it once
servicing is completed.

While here, re-factor the interrupt setup / tear-down code a bit to
eventually once day simplify supporting the FDT bindings for hid-over-i2c.


Revision tags: netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.1 10-Dec-2017 bouyer

Add drivers for HID over I2C devices, and a driver for I2C mices.
From OpenBSD.


# 1.2 22-Dec-2019 thorpej

The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts. However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the device in order to clear
the interrupt condition.

Address this by using acpi_intr_mask() to mask off the interrupt source
while a softint is pending to service the events, re-enabling it once
servicing is completed.

While here, re-factor the interrupt setup / tear-down code a bit to
eventually once day simplify supporting the FDT bindings for hid-over-i2c.


Revision tags: netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.1 10-Dec-2017 bouyer

Add drivers for HID over I2C devices, and a driver for I2C mices.
From OpenBSD.


# 1.1 10-Dec-2017 bouyer

Add drivers for HID over I2C devices, and a driver for I2C mices.
From OpenBSD.