]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Enhancements and fixes for the spigen(4) driver...
authorIan Lepore <ian@FreeBSD.org>
Wed, 11 Jul 2018 17:54:41 +0000 (17:54 +0000)
committerIan Lepore <ian@FreeBSD.org>
Wed, 11 Jul 2018 17:54:41 +0000 (17:54 +0000)
commit7a4f19151ab2cf3588d77a02933160316d2fa41a
treeba919f172dc12d2b70825b87d0d2cf343b4f28fc
parentb17f4335d2becd4ad1a74636675e4a3d273807a2
Enhancements and fixes for the spigen(4) driver...

- Resources used by spigen_mmap_single() are now tracked using
  devfs_set_cdevpriv() rather than in the softc.

- Since resources are now tracked per-open-fd, there is no need to try to
  impose any exclusive-open logic, so flags related to that are removed.

- Flags used to track open status to prevent detach() when the device is
  open are replaced with calls to device_busy()/device_unbusy().  That
  extends the protection up the hierarchy so that the spibus and hardware
  controller drivers also can't be detached while the device is open/in use.

- Arbitrary limits on the maximum size of a transfer are removed, along with
  the sysctl variables that allowed the limits to be changed.  There is just
  no reason to limit the size of a spi transfer to the machine's page size.
  Or to any other arbitrary value, really.

- Most of the locking is removed.  It was mostly protecting access to flags
  and fields in the softc that no longer exist.  The locking that remains is
  just to prevent concurrent calls to device_[un]busy().

- The code was calling malloc() with M_WAITOK while holding a mutex in
  several places.  Since most of the locking is gone, that's fixed.
sys/dev/spibus/spigen.c