kernel - Fix boot-time panic in NATA revealed by new callout mechanics
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 25 Nov 2014 22:11:42 +0000 (14:11 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 25 Nov 2014 22:11:42 +0000 (14:11 -0800)
commit15bd3c7353c5ce02776849ca16be00d5088d8734
tree498b79cd8a8036c66a94e991e508bf516319f8bd
parentfc8827e60596dc2cc33113727f58ab754b7c46df
kernel - Fix boot-time panic in NATA revealed by new callout mechanics

* The NATA driver was using spin locks in a very, very dangerous way.
  They did not play nice with the new blocking callout mechanism.

* Replace all of NATAs spinlocks with lockmgr locks.  In addition, change
  all asynchronous callout_stop() calls to synchronous callout_stop_sync()
  calls, and use callout_init_lk() to auto-lock ch->state_lock for the
  callback, which fixes a long-time deadlock race.

Reported-by: tuxillo
sys/dev/disk/nata/ata-all.c
sys/dev/disk/nata/ata-all.h
sys/dev/disk/nata/ata-chipset.c
sys/dev/disk/nata/ata-lowlevel.c
sys/dev/disk/nata/ata-queue.c
sys/dev/disk/nata/ata-raid.c
sys/dev/disk/nata/ata-raid.h
sys/dev/disk/nata/atapi-cam.c