HomeFreeBSD

Enhancements and fixes for the spigen(4) driver...

Description

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.

Details

Provenance
ianAuthored on
Parents
rS336201: smartpqi(4):
Branches
Unknown
Tags
Unknown