HomeFreeBSD

Fix the gpiobus locking by using a more sane model where it isn't necessary

Description

Fix the gpiobus locking by using a more sane model where it isn't necessary
hold the gpiobus lock between the gpio calls.

gpiobus_acquire_lock() now accepts a third parameter which tells gpiobus
what to do when the bus is already busy.

When GPIOBUS_WAIT wait is used, the calling thread will be put to sleep
until the bus became free.

With GPIOBUS_DONTWAIT the calling thread will receive EWOULDBLOCK right
away and then it can act upon.

This fixes the gpioiic(4) locking issues that arises when doing multiple
concurrent access on the bus.

Details

Provenance
loosAuthored on
Parents
rS273916: MFC r273733, r273740 and r273773:
Branches
Unknown
Tags
Unknown

Event Timeline