From patchwork Wed Jun 1 07:58:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhao xiao qiang X-Patchwork-Id: 9146243 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 CEE7260757 for ; Wed, 1 Jun 2016 08:01:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFD6B22473 for ; Wed, 1 Jun 2016 08:01:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B46532654B; Wed, 1 Jun 2016 08:01:08 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 0894822473 for ; Wed, 1 Jun 2016 08:01:07 +0000 (UTC) Received: from localhost ([::1]:40568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b815O-0002JT-HX for patchwork-qemu-devel@patchwork.kernel.org; Wed, 01 Jun 2016 04:01:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8151-0002FA-Cx for qemu-devel@nongnu.org; Wed, 01 Jun 2016 04:00:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b814x-0002kn-A7 for qemu-devel@nongnu.org; Wed, 01 Jun 2016 04:00:42 -0400 Received: from m12-18.163.com ([220.181.12.18]:44851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b814w-0002jn-Hi for qemu-devel@nongnu.org; Wed, 01 Jun 2016 04:00:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=7cL4SW7t0LiEvhgCBs 0c1+QVcQQ+BNnI6TUuGB7u8O8=; b=FoBMnGRkNgLsX5L0hwtbxrYZ0xJR2BeTM3 Koum8U/aXv9P8uy+MFSs0GTUvRrmHvU/N/ajn/QT8hMfBnMM9xQaI4OwMsnQto/G hGKnorHB0gQMZyaKy52GscFEC3u5HlbxDWyhFvCBKh9JpWcVttCg/J8M/tvqq1ND qqGfHodWg= Received: from localhost.localdomain (unknown [101.254.142.162]) by smtp14 (Coremail) with SMTP id EsCowED5qUWflU5XJPUFAA--.2602S2; Wed, 01 Jun 2016 15:59:55 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Wed, 1 Jun 2016 15:58:18 +0800 Message-Id: <1464767898-30526-1-git-send-email-zxq_yx_007@163.com> X-Mailer: git-send-email 2.1.4 X-CM-TRANSID: EsCowED5qUWflU5XJPUFAA--.2602S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7KrWkZF13ArWUtF1xJFyDtrb_yoW8XF45pr ZrGFn0gr48Xa12vFZxW3y8ur15XayxJa4I9ryxWwn3Xw15Crn0yr18ua4SqFyDXFyrAa15 AFWDXF1Iqr4kAwUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j5-B_UUUUU= X-Originating-IP: [101.254.142.162] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiOxx7xlXlT2HjbwAAsI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 220.181.12.18 Subject: [Qemu-devel] [PATCH] hw/char: QOM'ify escc.c (fix) 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: peter.maydell@linaro.org, mark.cave-ayland@ilande.co.uk, armbru@redhat.com, michael@walle.cc, edgar.iglesias@gmail.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The previous commit e7c9136977cb99c6eb52c9139f7b8d8b5fa87db9 (hw/char: QOM'ify escc.c) cause qemu-system-ppc/ppc64 OpenBIOS to freeze on startup, this commit fix it. Signed-off-by: xiaoqiang zhao Tested-by: Mark Cave-Ayland --- hw/char/escc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index 8e6a7df..31a5f90 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -989,18 +989,13 @@ static void escc_init1(Object *obj) SysBusDevice *dev = SYS_BUS_DEVICE(obj); unsigned int i; - s->chn[0].disabled = s->disabled; - s->chn[1].disabled = s->disabled; for (i = 0; i < 2; i++) { sysbus_init_irq(dev, &s->chn[i].irq); s->chn[i].chn = 1 - i; - s->chn[i].clock = s->frequency / 2; } s->chn[0].otherchn = &s->chn[1]; s->chn[1].otherchn = &s->chn[0]; - memory_region_init_io(&s->mmio, obj, &escc_mem_ops, s, "escc", - ESCC_SIZE << s->it_shift); sysbus_init_mmio(dev, &s->mmio); } @@ -1009,8 +1004,15 @@ static void escc_realize(DeviceState *dev, Error **errp) ESCCState *s = ESCC(dev); unsigned int i; + s->chn[0].disabled = s->disabled; + s->chn[1].disabled = s->disabled; + + memory_region_init_io(&s->mmio, OBJECT(dev), &escc_mem_ops, s, "escc", + ESCC_SIZE << s->it_shift); + for (i = 0; i < 2; i++) { if (s->chn[i].chr) { + s->chn[i].clock = s->frequency / 2; qemu_chr_add_handlers(s->chn[i].chr, serial_can_receive, serial_receive1, serial_event, &s->chn[i]); }