From patchwork Thu Oct 19 13:09:16 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: 735546 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1507579wro; Thu, 19 Oct 2023 06:12:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdnpMwTOb/E3g2eZ8ExRAaN9mTKmnGpKv2c49sOOTTZLZ8x2V3y4ddGf/nITGhxOc0oKIn X-Received: by 2002:a5d:534c:0:b0:32d:a4c9:8ab4 with SMTP id t12-20020a5d534c000000b0032da4c98ab4mr1597155wrv.65.1697721131434; Thu, 19 Oct 2023 06:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721131; cv=none; d=google.com; s=arc-20160816; b=iazkZ7AbrvDvIHXEQx1GE3QSkoL5QdJ2DSf6QjonKLzK2VcZSNZexo+Fw1UxaKF4zn bBikq6BwgAJ19zmfZE5g8PYgXxPv3jwjdFM/Eg8kC+jQz67+uk6iKhBqCc8Id7chfa0H /UauusxvOdTPZBmAhOAeBfYCJoxQR6wHt+FwRk6z3H3eGxDpnTi8DoVoaCXmIBqEXqeh +IKGkuWCzE+b1+Jrrkjyvo+AMCatsj927bWsqaTtcDt2QxAK41qguBqqPsxMl6D+zCcc GTscKfSaomRSNdydi9L+9GNzSDti7GhGuHtidxnGU/3y+CDHoeYj0+TxfGr2rmKmwgsx qq1Q== 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=WuH7XtOKs5G9Ns2H+BnAt+HjsoiLIzrJP7Sikrea0Vo=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=Gq37DVZ2SxwzGOAF4za0iGcWPUKgdLu6dndZSN5cA3PJphYCbNvkVboa3jliGvD5s7 GZryUTroRhLwSIX/eiF+ymeCu1+WNQEOTQtsTFeVk3c8jz35tf0+cHgP4nj0ytUDU5jj Wq9X70TsDIsTLL1rmGHwtITzAi4WHF2K7HJnceFfEeWFdlmwipig3MnreBS9xZRkErRT C9ZvSI8vBFIZpq1wsGlYQ1q4b8pEtRrrxIgVrznvCsQd2n8ykaQiDAWSEzYlm4FBZd8k aHlwmcDTXAEF+IoLh51WEwUsSDofcjHgbRM45c469jGkSpjLhyVfRp8x/QArw3TamJAt tEDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i92aIzOU; 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 g9-20020adff409000000b0032d83568f47si2557904wro.457.2023.10.19.06.12.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:12:11 -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=i92aIzOU; 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 1qtSmj-0004aE-Iw; Thu, 19 Oct 2023 09:09:57 -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 1qtSmR-0004MB-7t for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:47 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmO-0007Dn-TC for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:38 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4083f61322fso13215055e9.1 for ; Thu, 19 Oct 2023 06:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720974; x=1698325774; 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=WuH7XtOKs5G9Ns2H+BnAt+HjsoiLIzrJP7Sikrea0Vo=; b=i92aIzOUdayOZ6agwNL5c/JOzhuUpczsum+3ccFhwjCw7yhD5w3NoB3EuG8SQNvuCs rQOGKXYmUBaoS7hkozxUD5KLB4HLTI837EctSTMVUE5VbVHKpvO1QYcKKx/hpEpaqqyo edvg095qMpRhc3jbPMyhBz9RdPUPxYu9yUJVltu0m7Fz6UNCFyDUKN19M8RoMSPsVtqt kw6Zwd7Q5pEwDzu6NWukXQejItc0qS/vJWh2RiXXNjCd9OikwnWxRHVcMKvQ6mM/kcoM EB6eq5miedZM7319qkIExGlaN3JtKB0/BuMQEPyfxdIMu35MvCerQaHzbQ1OxPYgrpro iaTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720974; x=1698325774; 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=WuH7XtOKs5G9Ns2H+BnAt+HjsoiLIzrJP7Sikrea0Vo=; b=qzqpTIHAKj+9odJcgDqOC8c1P0Ll0O4fT+4DAREGHaa7SzE5Mq0L6vczuwbIqVrzYn FzToDdnKcL7/ScJv7CHkrIRKPvhiLCMi4Dc8qobmKedyN8rZtq0v7Jl+0R7tlYhzwHTI TgLabnNXSCGSxjA1ITKXagbyg8+oJeGY5aBnQJKTAx9sf/xASvwqNXu0l1U+ft/byWhU Z0WT/TQFBzdcG9woRajRREqpO4xMBN8tlo2GzAiYKNx2OZZo3iamrpR/G9lkrD1zl0Hp 0TSCdluvUxMwUeumUdwwfMxtU2v14x/y+opRC/jUzhZoYFgYGamn/ZcWkJ97saKK6vVO ZYCw== X-Gm-Message-State: AOJu0YyklxUg9WP3ojmixoxIC9mSKayGZjI2/VSSwfkgrkxVJvswzyW0 0oZNOJxNf0rmrFq6+x+qhgDrf4ucDZ+q6BMIY9TjcQ== X-Received: by 2002:a05:600c:4588:b0:3fb:a102:6d7a with SMTP id r8-20020a05600c458800b003fba1026d7amr1762628wmo.28.1697720973980; Thu, 19 Oct 2023 06:09:33 -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 17-20020a05600c231100b00401d8181f8bsm4373980wmo.25.2023.10.19.06.09.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:33 -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 1/9] hw/sd/pxa2xx: Realize sysbus device before accessing it Date: Thu, 19 Oct 2023 15:09:16 +0200 Message-ID: <20231019130925.18744-2-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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() and sysbus_connect_irq() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Reviewed-by: Thomas Huth --- hw/sd/pxa2xx_mmci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 124fbf8bbd..9f7a880bac 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -483,11 +483,11 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, dev = qdev_new(TYPE_PXA2XX_MMCI); sbd = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(sbd, &error_fatal); sysbus_mmio_map(sbd, 0, base); sysbus_connect_irq(sbd, 0, irq); qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma); qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma); - sysbus_realize_and_unref(sbd, &error_fatal); return PXA2XX_MMCI(dev); }