From patchwork Wed Jun 12 21:41:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 250921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C24352C008C for ; Thu, 13 Jun 2013 09:11:29 +1000 (EST) Received: from localhost ([::1]:44528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmuCN-0006kS-Pq for incoming@patchwork.ozlabs.org; Wed, 12 Jun 2013 19:11:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Umsrq-00072W-Rs for qemu-devel@nongnu.org; Wed, 12 Jun 2013 17:46:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Umsrp-0001LE-Eg for qemu-devel@nongnu.org; Wed, 12 Jun 2013 17:46:10 -0400 Received: from mail-ie0-x22b.google.com ([2607:f8b0:4001:c03::22b]:35587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Umsrp-0001L1-9n; Wed, 12 Jun 2013 17:46:09 -0400 Received: by mail-ie0-f171.google.com with SMTP id qd12so10304232ieb.16 for ; Wed, 12 Jun 2013 14:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=RL6AntM+Tv6gn7bE3Jz68ILflE3mZ9JhiLNayYADVj0=; b=exEz/aB7FL2uDv8+TVnkbXgOrV5BmKVgPTOyOr9ISZYHFYUQmZSuEJwMXPyT3UHja7 v9XtLd6AjJKk+W7C2tIImSlOvIq3BZhFDPThr1ZfXeMmxQO6jIWkxd6Y3ATIM82o+M2d eAZ8TD+L7aQUjk1xDNweFfDxB7hMaNv+Zfs/FeiMl+WHFVhm+NlHDKDTPlqDwlbXIcho EkpeG7nN66d9sR9dNWWWETR/nyklr5rfWT9Pujk28habfDzDbymH7E5twL5hgOTqUE1i GSJWmSscIzUU5ozo8LwUgjMkbYOCFhqgmB8ZKmW6mC+86SEE4MNBEcBB9+vsJqxJ2c36 6Obg== X-Received: by 10.50.130.78 with SMTP id oc14mr4379409igb.48.1371073568698; Wed, 12 Jun 2013 14:46:08 -0700 (PDT) Received: from localhost ([32.97.110.51]) by mx.google.com with ESMTPSA id y11sm20253747igy.10.2013.06.12.14.46.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 12 Jun 2013 14:46:08 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 12 Jun 2013 16:41:35 -0500 Message-Id: <1371073298-14519-24-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371073298-14519-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1371073298-14519-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22b Cc: qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 23/26] xilinx_axidma: Do not set DMA .notify to NULL after notify X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Wendy Liang If a stream notify function is not ready, it may re-populate the notify call- back to indicate it should be re-polled later. This break in this usage, as immediately following the notify() call, .notify is set to NULL. reverse the ordering of the notify call and NULL assignment accordingly. [PC: Reworked commit message] Signed-off-by: Wendy Liang Signed-off-by: Peter Crosthwaite Signed-off-by: Edgar E. Iglesias (cherry picked from commit 4f293bd6e53739e089f33b458f70a9c4ac136b92) Signed-off-by: Michael Roth --- hw/dma/xilinx_axidma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 3a3ef8a..50054cf 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -514,8 +514,9 @@ static void axidma_write(void *opaque, hwaddr addr, break; } if (sid == 1 && d->notify) { - d->notify(d->notify_opaque); + StreamCanPushNotifyFn notifytmp = d->notify; d->notify = NULL; + notifytmp(d->notify_opaque); } stream_update_irq(s); }