pnv/psi: Add device reset hook
commitfcb7e4a8f4e220306ac0c5acda66ca255d79f658
authorGreg Kurz <groug@kaod.org>
Tue, 7 Jan 2020 16:32:40 +0000 (7 17:32 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 8 Jan 2020 00:06:42 +0000 (8 11:06 +1100)
tree3450f360a31b015017dd0df27d21f4773c75add6
parent806fed593d0ed88d2f11e45cc54612daec98fe27
pnv/psi: Add device reset hook

And call it from a QEMU reset handler. This allows each PNV child class to
override the reset hook if needed, eg. POWER8 doesn't but POWER9 does.
The proper way to do that would be to use device_class_set_parent_reset(),
but defining a Pnv8PsiClass and a Pnv9PsiClass types with a parent_reset
pointer adds a fair amount of code. Calling pnv_psi_reset() explicitely is
fine for now.

A subsequent patch will consolidate the call to qemu_register_reset() in
a single place.

Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <157841476035.66386.17838417527621752518.stgit@bahia.tlslab.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/pnv_psi.c