diff options
author | jah <jah@FreeBSD.org> | 2015-04-21 11:50:31 +0000 |
---|---|---|
committer | jah <jah@FreeBSD.org> | 2015-04-21 11:50:31 +0000 |
commit | 25e5e803e77bc9385fbd54fcaf14eae06251d6f8 (patch) | |
tree | bb835543b8a361d83645cb2c61c7e198c0c33f65 /lib/libc | |
parent | 1c8b5426f3f10c739d5a27e6db5e0a9f247224e8 (diff) | |
download | FreeBSD-src-25e5e803e77bc9385fbd54fcaf14eae06251d6f8.zip FreeBSD-src-25e5e803e77bc9385fbd54fcaf14eae06251d6f8.tar.gz |
Fix numerous issues in iic(4) and iicbus(4):
--Allow multiple open iic fds by storing addressing state in cdevpriv
--Fix, as much as possible, the baked-in race conditions in the iic
ioctl interface by requesting bus ownership on I2CSTART, releasing it on
I2CSTOP/I2CRSTCARD, and requiring bus ownership by the current cdevpriv
to use the I/O ioctls
--Reduce internal iic buffer size and remove 1K read/write limit by
iteratively calling iicbus_read/iicbus_write
--Eliminate dynamic allocation in I2CWRITE/I2CREAD
--Move handling of I2CRDWR to separate function and improve error handling
--Add new I2CSADDR ioctl to store address in current cdevpriv so that
I2CSTART is not needed for read(2)/write(2) to work
--Redesign iicbus_request_bus() and iicbus_release_bus():
--iicbus_request_bus() no longer falls through if the bus is already
owned by the requesting device. Multiple threads on the same device may
want exclusive access. Also, iicbus_release_bus() was never
device-recursive anyway.
--Previously, if IICBUS_CALLBACK failed in iicbus_release_bus(), but
the following iicbus_poll() call succeeded, IICBUS_CALLBACK would not be
issued again
--Do not hold iicbus mtx during IICBUS_CALLBACK call. There are
several drivers that may sleep in IICBUS_CALLBACK, if IIC_WAIT is passed.
--Do not loop in iicbus_request_bus if IICBUS_CALLBACK returns
EWOULDBLOCK; instead pass that to the caller so that it can retry if so
desired.
Differential Revision: https://reviews.freebsd.org/D2140
Reviewed by: imp, jhb, loos
Approved by: kib (mentor)
Diffstat (limited to 'lib/libc')
0 files changed, 0 insertions, 0 deletions