From patchwork Mon Jun 6 17:35:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9158941 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 B417960759 for ; Mon, 6 Jun 2016 17:38:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A82B925EF7 for ; Mon, 6 Jun 2016 17:38:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CFE52834E; Mon, 6 Jun 2016 17:38:36 +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 A957A25EF7 for ; Mon, 6 Jun 2016 17:38:35 +0000 (UTC) Received: from localhost ([::1]:44219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9yTy-0004Qc-Mz for patchwork-qemu-devel@patchwork.kernel.org; Mon, 06 Jun 2016 13:38:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9yR2-0002Ak-Jq for qemu-devel@nongnu.org; Mon, 06 Jun 2016 13:35:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9yR0-0001Mh-Ha for qemu-devel@nongnu.org; Mon, 06 Jun 2016 13:35:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9yR0-0001MZ-CO for qemu-devel@nongnu.org; Mon, 06 Jun 2016 13:35:30 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED37B9B0C0; Mon, 6 Jun 2016 17:35:29 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u56HZNDj025291; Mon, 6 Jun 2016 13:35:28 -0400 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 6 Jun 2016 19:35:12 +0200 Message-Id: <1465234520-11160-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1465234520-11160-1-git-send-email-pbonzini@redhat.com> References: <1465234520-11160-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 06 Jun 2016 17:35:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/11] 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: xiaoqiang zhao Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: xiaoqiang zhao 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 Message-Id: <1464767898-30526-1-git-send-email-zxq_yx_007@163.com> Signed-off-by: Paolo Bonzini --- 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]); }