virtio scsi: Convert to hotplug state machine
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 6 Sep 2016 17:04:46 +0000 (19:04 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 19 Sep 2016 19:44:29 +0000 (21:44 +0200)
commit8904f5a5afc4dd74e8fe2ab3eeb98018ef02f3e6
tree7ccdcb19dabfc8dec5b77b3a8200005a23cf8b1c
parenta4e0591ece7d88634a802c4076db8c0debbde805
virtio scsi: Convert to hotplug state machine

Install the callbacks via the state machine. It uses the multi instance
infrastructure of the hotplug code to handle each interface.

virtscsi_set_affinity() is removed from virtscsi_init() because
virtscsi_cpu_notif_add() (the function which registers the instance) is invoked
right after it and the cpuhp_state_add_instance() functions invokes the startup
callback on all online CPUs.

The same thing can not be applied virtscsi_cpu_notif_remove() because
virtscsi_remove_vqs() invokes virtscsi_set_affinity() with affinity = false as
argument but the old CPU_DEAD state invoked the function with affinity = true
(which does not match the DEAD callback).

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: virtualization@lists.linux-foundation.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160906170457.32393-11-bigeasy@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/scsi/virtio_scsi.c
include/linux/cpuhotplug.h