From 63d421e8812b9118286c13116c8469ae20123f56 Mon Sep 17 00:00:00 2001 From: Dor Laor <dlaor@redhat.com> Date: Wed, 30 Dec 2009 11:07:16 -0200 Subject: [PATCH 5/6] The driver/device pair does not have a reset option (1) RH-Author: Dor Laor <dlaor@redhat.com> Message-id: <patch-6003-clone-for-rhel5> Patchwork-id: 6088 O-Subject: [resend] [kvm 5.4.z, 5.5][PATCH 1/2] The driver/device pair does not have a reset option Bugzilla: 550755 RH-Acked-by: Juan Quintela <quintela@redhat.com> RH-Acked-by: Gleb Natapov <gleb@redhat.com> RH-Acked-by: Naphtali Sprei <nsprei@redhat.com> On 12/30/2009 01:02 PM, Dor Laor wrote: Resend, without the printf. >From fb4696b3995be8e6c9cc9fbbfec8952488228ed7 Mon Sep 17 00:00:00 2001 From: Dor Laor <dor@redhat.com> Date: Tue, 29 Dec 2009 17:22:08 +0200 Subject: [PATCH] The driver/device pair does not have a reset option to call when the driver is unloaded / system is rebooted. As a result, there might be cases where the irq line will stay asserted and the system will consume 100% cpu bz550755 Signed-off-by: Dor Laor <dor@redhat.com> --- qemu/hw/hypercall.c | 6 +++++- qemu/hw/hypercall.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu/hw/hypercall.c | 6 +++++- qemu/hw/hypercall.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/qemu/hw/hypercall.c b/qemu/hw/hypercall.c index 71f5bf4..9063224 100644 --- a/qemu/hw/hypercall.c +++ b/qemu/hw/hypercall.c @@ -101,7 +101,11 @@ static void hp_ioport_write(void *opaque, uint32_t addr, uint32_t val) } break; case HP_VERSION_REGISTER: - if (s->version == val) + if (val == HP_DRIVER_UNREGISTER) { + hp_reset(s); + break; + } + else if (s->version == val) s->driver_state |= HP_DRIVER_INITELIZED; else printf("%s:version mismatch: ours %d, driver's %d\n", __FUNCTION__, s->version, val); diff --git a/qemu/hw/hypercall.h b/qemu/hw/hypercall.h index de0a414..ae6c67f 100644 --- a/qemu/hw/hypercall.h +++ b/qemu/hw/hypercall.h @@ -36,6 +36,9 @@ //After version check #define HP_DRIVER_INITELIZED 1 +//Write HP_DRIVER_UNREGISTER on driver exit/release to HP_VERSION_REGISTER +#define HP_DRIVER_UNREGISTER 0 + // Bits in HCR_REGISTER #define HCR_IRQ_ON 1 -- 1.6.3.rc4.29.g8146