From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56612 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pkdvx-0004NG-Go for qemu-devel@nongnu.org; Wed, 02 Feb 2011 09:44:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkYyT-0004H5-AC for qemu-devel@nongnu.org; Wed, 02 Feb 2011 04:26:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkYyT-0004Gy-3L for qemu-devel@nongnu.org; Wed, 02 Feb 2011 04:26:05 -0500 Message-ID: <4D492344.3070307@redhat.com> Date: Wed, 02 Feb 2011 10:26:28 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 7/7] ahci: work around bug with level interrupts References: <1296571892-12702-1-git-send-email-agraf@suse.de> <1296585301-15510-1-git-send-email-agraf@suse.de> <20110201195824.GB17924@volta.aurel32.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Joerg Roedel , qemu-devel Developers , Aurelien Jarno , Sebastian Herbszt Am 01.02.2011 21:10, schrieb Alexander Graf: > > On 01.02.2011, at 20:58, Aurelien Jarno wrote: > >> On Tue, Feb 01, 2011 at 07:35:01PM +0100, Alexander Graf wrote: >>> When using level based interrupts, the interrupt is treated the same as an >>> edge triggered one: leaving the line up does not retrigger the interrupt. >>> >>> In fact, when not lowering the line, we won't ever get a new interrupt inside >>> the guest. So let's always retrigger an interrupt as soon as the OS ack'ed >>> something on the device. This way we're sure the guest doesn't starve on >>> interrupts until someone fixes the actual interrupt path. >>> >>> Signed-off-by: Alexander Graf >>> >>> --- >>> >>> v2 -> v3: >>> >>> - add comment about the interrupt hack >>> --- >>> hw/ide/ahci.c | 8 ++++++-- >>> 1 files changed, 6 insertions(+), 2 deletions(-) >>> >>> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c >>> index 98bdf70..95e1cf7 100644 >>> --- a/hw/ide/ahci.c >>> +++ b/hw/ide/ahci.c >>> @@ -152,11 +152,15 @@ static void ahci_check_irq(AHCIState *s) >>> } >>> } >>> >>> + /* XXX We lower the interrupt line here because of a bug with interrupt >>> + handling in Qemu. When leaving a line up, the interrupt does >>> + not get retriggered automatically currently. Once that bug is fixed, >>> + this workaround is not necessary anymore and we only need to lower >>> + in the else branch. */ >>> + ahci_irq_lower(s, NULL); >>> if (s->control_regs.irqstatus && >>> (s->control_regs.ghc & HOST_CTL_IRQ_EN)) { >>> ahci_irq_raise(s, NULL); >>> - } else { >>> - ahci_irq_lower(s, NULL); >>> } >>> } >>> >> >> It's a lot better that way, however I think we should still keep the >> correct code. Also given this problem only concerns the i386 target (ppc >> code is actually a bit strange, but at the end does the correct thing), >> it's something we should probably mention. >> >> What about something like that? > > While I dislike #if 0s in released code in general, it's fine with me. I know what I meant based on the comment, but for others this might make it more explicit. How would we go about committing this? Kevin, will you just change the code inside your tree? I would prefer if you sent a new version of this patch. Kevin