From patchwork Tue Oct 24 23:29:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Pisa X-Patchwork-Id: 10025525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CADDA601E8 for ; Tue, 24 Oct 2017 23:31:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC8CD28AA3 for ; Tue, 24 Oct 2017 23:31:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B13A228AA7; Tue, 24 Oct 2017 23:31:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 69A6B28AA3 for ; Tue, 24 Oct 2017 23:31:40 +0000 (UTC) Received: from localhost ([::1]:45916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e78fb-0005pj-Ma for patchwork-qemu-devel@patchwork.kernel.org; Tue, 24 Oct 2017 19:31:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e78eS-0005n7-Sa for qemu-devel@nongnu.org; Tue, 24 Oct 2017 19:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e78eR-0000V0-PL for qemu-devel@nongnu.org; Tue, 24 Oct 2017 19:30:28 -0400 Received: from smtp8.web4u.cz ([81.91.87.88]:42724 helo=mx-8.mail.web4u.cz) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e78eR-0000Tw-Is for qemu-devel@nongnu.org; Tue, 24 Oct 2017 19:30:27 -0400 Received: from baree.pikron.com (unknown [89.102.4.32]) (Authenticated sender: ppisa@pikron.com) by mx-8.mail.web4u.cz (Postfix) with ESMTPA id 707641FFFB2; Wed, 25 Oct 2017 01:30:26 +0200 (CEST) From: pisa@cmp.felk.cvut.cz To: qemu-devel@nongnu.org Date: Wed, 25 Oct 2017 01:29:44 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: <7df70170550e3a10152a3571012f507dd035ba7c.1508885974.git.pisa@cmp.felk.cvut.cz> References: <7df70170550e3a10152a3571012f507dd035ba7c.1508885974.git.pisa@cmp.felk.cvut.cz> In-Reply-To: References: X-W4U-Auth: fdd471199c0f65df6dd5ceed0b79ba78058e2c74 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 81.91.87.88 Subject: [Qemu-devel] [PATCH 4/6] Fixed IRQ problem for CAN device can_pcm3680_pci. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Stefan Hajnoczi , Deniz Eren , Jan Kiszka , Oliver Hartkopp , Pavel Pisa , Konrad Frederic Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Deniz Eren Signed-off-by: Pavel Pisa Signed-off-by: A Signed-off-by: B --- hw/can/can_pcm3680_pci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/can/can_pcm3680_pci.c b/hw/can/can_pcm3680_pci.c index 77523f2ddb..bc6b164ea7 100644 --- a/hw/can/can_pcm3680_pci.c +++ b/hw/can/can_pcm3680_pci.c @@ -61,6 +61,7 @@ typedef struct Pcm3680iPCIState { MemoryRegion sja_io[2]; CanSJA1000State sja_state[2]; + qemu_irq irq; char *model; /* The model that support, only SJA1000 now. */ char *canbus[2]; @@ -69,10 +70,16 @@ typedef struct Pcm3680iPCIState { static void pcm3680i_pci_irq_raise(void *opaque) { + Pcm3680iPCIState *d = (Pcm3680iPCIState *)opaque; + + qemu_irq_raise(d->irq); } static void pcm3680i_pci_irq_lower(void *opaque) { + Pcm3680iPCIState *d = (Pcm3680iPCIState *)opaque; + + qemu_irq_lower(d->irq); } static void @@ -206,6 +213,8 @@ static int pcm3680i_pci_init(PCIDevice *pci_dev) pci_conf = pci_dev->config; pci_conf[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin A */ + d->irq = pci_allocate_irq(&d->dev); + can_sja_init(s1, pcm3680i_pci_irq_raise, pcm3680i_pci_irq_lower, d); can_sja_init(s2, pcm3680i_pci_irq_raise, pcm3680i_pci_irq_lower, d); @@ -254,6 +263,8 @@ static void pcm3680i_pci_exit(PCIDevice *pci_dev) can_sja_exit(s1); can_sja_exit(s2); + + qemu_free_irq(d->irq); } static const VMStateDescription vmstate_pcm3680i_pci = {