From patchwork Thu Oct 19 13:09:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 735538 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1506699wro; Thu, 19 Oct 2023 06:10:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHACAjFtLUiDg/6E0TTL5VPVzYzBWOPpyayhggTKKK/ZJRXCiv+tMwtMbCb3ayQ9iSYcKcm X-Received: by 2002:a5d:42d1:0:b0:32d:a369:1820 with SMTP id t17-20020a5d42d1000000b0032da3691820mr1412276wrr.64.1697721032645; Thu, 19 Oct 2023 06:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721032; cv=none; d=google.com; s=arc-20160816; b=KOMI4fMsjD+FDuntLafCSp1wl0UCGiHwMWlyFF/pZfVUPJcyZQZqidsawg5HwyEfkF nK3pYx86LSW8EV5xeTQd1lEsmixq/pRePz/s8z6T+iQDsKnnvKlhkyWCcOSFhIUUw//i O0n0nzqZ7HBXGzm+/RYnV1fqjR+bBDucW6KVumxkP0bqlb9zLrXQekLikw5FNLyOKLev a9eiT+W/rnjFwpDjhEKWFHE91XDyEMW1fy+hWfuDgyxMyLqXLbURJEy5MxDRi6rVwGIU Ygv3V+dqgccG8Q8lx3QvvZCFC8naODVAx7zOmVtBy12k0KwSwl/BGAZxNK5BZ17FxyQK tdrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e3Wrm2+hEgcQGJPeHM5sv3LDR90OXcyWyLu0fpUZ2rw=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=sXc9/pQuXBeb2G89MN99jF+3wEwiLUBd64V9196qSkU+Ew16JoI08qiQ7tMV7kLZQ3 IXi+crFA6Ar8GNd1lEUZNgK118oTGrVX6DNBD/iSqocxV3zj/aIseUi2zmrbsRjMNLW4 amE7X/aeeGB879AChw44tdxGm3cMyWGus8j3mPpjmsZAy34wsgJ/RcdSHw7YOpwOP1kv Y7G39I6PLizMqU1XW5fuSi1Nh8rQ8c+dp+fler5hW/Yca6AaJUBAqiBUJgh+Ei0AXWMa nEoPRtsp832yvxtVxtqdXUwFgzPiNLJ2+TGeXgHoixGdFpb/rorq6+hlp17JCX9V4zT6 Oodg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zbK9Zyo4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d4-20020a056000114400b0032d9d845f47si2560710wrx.375.2023.10.19.06.10.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:10:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zbK9Zyo4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSmq-0004wn-Bg; Thu, 19 Oct 2023 09:10:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtSma-0004N6-BT for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:53 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmY-0007bT-Qh for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:48 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32d8c2c6dfdso7085965f8f.1 for ; Thu, 19 Oct 2023 06:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720985; x=1698325785; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e3Wrm2+hEgcQGJPeHM5sv3LDR90OXcyWyLu0fpUZ2rw=; b=zbK9Zyo417DCzyH8E4A2HqVhjOUKdl3LFcSRuAj0WoDsv5eHBCDCMtpLheDO6Iy6fJ 2UQBb/wFbEXf/J1V7NkpTbd1gVVRirNQkErukNcO/9rST5QWUhZipCO40GjqYzQE2yim Mf9lh0NitDKZIfPqBjmFAFjL0KMQumHvDUjYjj33IImM7f6+Lnn7baha9O2U/JZRCtc/ SSweHfJhqk6P1AFaEqgh2SmqVc9zEMXaHl/FYEeueJQFJy7PrpdmAdQqHQybk298gtrS gKMtfdbUlE0juqPMOh6Kq+ATOgUt8ZNfKFslTz0d0/H0i1FbmH052alT+Jpf7wZfEq/L XKdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720985; x=1698325785; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e3Wrm2+hEgcQGJPeHM5sv3LDR90OXcyWyLu0fpUZ2rw=; b=o9wPyL7LC9SmriqJ9yG18r3bBkKah6YJ24EI3yPDmFEwj+uPnHdJS9g5nnFOR5lWeR dEVBxeQ/rE0vzZveCtG5FLvl9g1khhfA+GHcNKjyWNK8MQ6V6xGCdlucwPGO59o5Flyf 4wYLztY/rN0fzSQAuy3I8EMAghj8wc23ifOtm1xg5ttdpJsYg2N9Mc7KWZmWj1xNn7Yb GSWqPWfyqGyDpgjaWSgWB5vcd2Z0HMFuAeGYpmgfXUz/H0IJQ3rXxsEhMAsjmLW4RK3c p1nQ6Lacw/IygfTFQHi04kgB26YM6O3bsnHzRVRQzXejQza5zAaZcsfY/gC4jadK6BrA tIlw== X-Gm-Message-State: AOJu0Ywu8t6dzzv3qHqs8CRqrbkg9LkoXQ/ELlDhuTDqMheMmUpJhDru 83l9uv99Qe0pFxcOYydGKq3K9aZsxQdeuPQLy39gFA== X-Received: by 2002:adf:db4b:0:b0:32d:b06c:80b5 with SMTP id f11-20020adfdb4b000000b0032db06c80b5mr1581493wrj.2.1697720985190; Thu, 19 Oct 2023 06:09:45 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id k1-20020a5d66c1000000b0032dbf99bf4fsm4439609wrw.89.2023.10.19.06.09.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/9] hw/pcmcia/pxa2xx: Realize sysbus device before accessing it Date: Thu, 19 Oct 2023 15:09:18 +0200 Message-ID: <20231019130925.18744-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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 sysbus_mmio_map() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/pcmcia/pxa2xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index fcca7e571b..e7264feb45 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -142,15 +142,12 @@ PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base) { DeviceState *dev; - PXA2xxPCMCIAState *s; dev = qdev_new(TYPE_PXA2XX_PCMCIA); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - s = PXA2XX_PCMCIA(dev); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - return s; + return PXA2XX_PCMCIA(dev); } static void pxa2xx_pcmcia_initfn(Object *obj)