kernel - Fix mmcsd read/write issues
commitfd4b97583be1a1e57234713c25f6e81bc0411cb0
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 29 Oct 2016 04:48:11 +0000 (28 21:48 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 29 Oct 2016 05:14:54 +0000 (28 22:14 -0700)
tree07cf56334899b914cae04474503b01231f377383
parentf1591f08811f69cff80209cdee0b498dc92356ab
kernel - Fix mmcsd read/write issues

* b_resid was not being set to 0 on a successful read or write, resulting
  in random short-read and short-write returns for requests.  Fixing this
  fixes nominal block I/O via the mmcsd disk device.

* bus/mmc now uses tsleep() instead of DELAY for the 10ms pause in
  request/command wait loops.

* bus/mmc reduces the TIMEOUT from 10 seconds to 1 second after the first
  TIMEOUT, only increasing it back to 10 seconds when timeouts stop
  occurring.  This reduces boot-time delays when a mmc port is dead or
  powered down.
sys/bus/mmc/mmc.c
sys/dev/disk/mmcsd/mmcsd.c