From patchwork Fri Jun 12 12:19:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 49824 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D17AE211FD for ; Fri, 12 Jun 2015 12:20:39 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf9307303lbb.1 for ; Fri, 12 Jun 2015 05:20:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=judmbwtIksXts0te5eGIxIimoL24KIARjFL0St0em14=; b=ebljCeDtUkbRnlzBLgQo42JTNNobDYIW/yy/wBk9WDtNMY1BpCMO8Qf8HqOiQ+Llko 6jlyBMb+TIpR3soKB5aenMPeo3bjE1ZehYz71MsUFQ5VzbCFENAnBASFcHHkWlldELEf VObNbAiFtN+85YjzKms4nShvSRk/goneh1JA1NPEFdWRLUhAdIExrIS6i6AKjzhIqNpA 3M/e8lehkxS5nQCdIEWctVshxdjPU6kMGNMHrUWJsB6GBBnqEpVz7VGz0ePT3WWX2sgQ JNl1fNHotercUO3nj6FMTC/+AX8bYtMlWHPpHYrA6oK9TPvcr7yiGoCrndF0LyxMWFDT GKPg== X-Gm-Message-State: ALoCoQm5+KLER9tfr5NMWTJgtrvL7jNVRJyQgFHw+UMN2K4XtqPvbAR3XJkVRD8TeYUgR9IkN62F X-Received: by 10.194.158.134 with SMTP id wu6mr14064051wjb.6.1434111638853; Fri, 12 Jun 2015 05:20:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.162 with SMTP id n2ls572824laf.82.gmail; Fri, 12 Jun 2015 05:20:38 -0700 (PDT) X-Received: by 10.152.88.99 with SMTP id bf3mr14578022lab.97.1434111638653; Fri, 12 Jun 2015 05:20:38 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id lf3si3131144lbb.3.2015.06.12.05.20.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2015 05:20:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so18918896lbb.3 for ; Fri, 12 Jun 2015 05:20:37 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr14676976lbc.117.1434111637197; Fri, 12 Jun 2015 05:20:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp522174lbb; Fri, 12 Jun 2015 05:20:36 -0700 (PDT) X-Received: by 10.55.22.28 with SMTP id g28mr28767764qkh.66.1434111635358; Fri, 12 Jun 2015 05:20:35 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 84si3588668qkq.78.2015.06.12.05.20.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Jun 2015 05:20:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:50983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3Nwo-00021p-Hi for patch@linaro.org; Fri, 12 Jun 2015 08:20:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3NwK-0001gU-58 for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:20:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3NwG-0005jX-5b for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:20:04 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:33556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3NwF-0005jT-Vr for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:20:00 -0400 Received: by wiwd19 with SMTP id d19so16991683wiw.0 for ; Fri, 12 Jun 2015 05:19:59 -0700 (PDT) X-Received: by 10.180.205.168 with SMTP id lh8mr6148710wic.95.1434111599463; Fri, 12 Jun 2015 05:19:59 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id wi1sm5597501wjb.41.2015.06.12.05.19.57 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jun 2015 05:19:57 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, peter.crosthwaite@xilinx.com Date: Fri, 12 Jun 2015 13:19:42 +0100 Message-Id: <1434111582-9325-1-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.177 Subject: [Qemu-devel] [PATCH] hw/arm/boot: fix rom_reset notifier registration order 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 commit ac9d32e39664e060cd1b538ff190980d57ad69e4 had the consequence to register the do_cpu_reset after the rom_reset one. Hence they get executed in the wrong order. This commit restores the registration of do_cpu_reset in arm_load_kernel. Signed-off-by: Eric Auger --- hw/arm/boot.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index d036624..1e7fd28 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -574,15 +574,6 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) struct arm_boot_info *info = container_of(n, struct arm_boot_info, load_kernel_notifier); - /* CPU objects (unlike devices) are not automatically reset on system - * reset, so we must always register a handler to do so. If we're - * actually loading a kernel, the handler is also responsible for - * arranging that we start it correctly. - */ - for (cs = CPU(cpu); cs; cs = CPU_NEXT(cs)) { - qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); - } - /* Load the kernel. */ if (!info->kernel_filename || info->firmware_loaded) { @@ -783,7 +774,18 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) { + CPUState *cs; + info->load_kernel_notifier.cpu = cpu; info->load_kernel_notifier.notifier.notify = arm_load_kernel_notify; qemu_add_machine_init_done_notifier(&info->load_kernel_notifier.notifier); + + /* CPU objects (unlike devices) are not automatically reset on system + * reset, so we must always register a handler to do so. If we're + * actually loading a kernel, the handler is also responsible for + * arranging that we start it correctly. + */ + for (cs = CPU(cpu); cs; cs = CPU_NEXT(cs)) { + qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); + } }