From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697723748; cv=none; d=zohomail.com; s=zohoarc; b=em5tTVJ+21TJf39JP/2fvVGp41+7A5UI5JMId09i/nQFK5VSJdIQ8nXJMGeRtxN2mZkYIa7G+PFV82Z7LwLT5rbfaVk/314WAAj3G5fgnz3kt6KaQwU2GwVKOyf+s7Xp4hkVTYBONye7xTn2zC2CdpWJyHaagGwZDmUQS9Bn2Mk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697723748; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WuH7XtOKs5G9Ns2H+BnAt+HjsoiLIzrJP7Sikrea0Vo=; b=mIox0t/4jFJt2nJt9wELuFTDCm+dBOUQJQnZFKKMlQfwgtrXm507L4Z2Butb9+DX3UUqD9zpIqt26YotJeOxjdlMYVOkiO/MDGeXvIhsqDosTlSEnChcYPpCTc1oUkH0hZTHV5Bhnqu6s7ar9joojGutA6qClrZ2r+cbBn7se1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697723748635130.47421171579856; Thu, 19 Oct 2023 06:55:48 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: AGHT+IGDsJfbILsr2xJPe+a80Wy1FrKTGIMKsJG202Jf+9zGebWakE5HODkgVHapM/P1H6Cqc9T+bQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697723748960100001 sysbus_mmio_map() and sysbus_connect_irq() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 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 *sysme= m, =20 dev =3D qdev_new(TYPE_PXA2XX_MMCI); sbd =3D 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); =20 return PXA2XX_MMCI(dev); } --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697725743; cv=none; d=zohomail.com; s=zohoarc; b=CFpW75wtJohkZHKxmQW01Fk2xxrln1CAjQzOuTj/1c+NEf3VQoinNKkFeMd7kccL2Geh0ZMs3XocI/u2RcW+PVDjnFEgK0qSInCv3nwhBDjFa8Mq589SVPzm7AoSZejmla8MIYBaYZXCYoEabcP5sgO/M3UA8b/ZU+HCNcRSHsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697725743; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AJfJ06RDafLRLEOQTU58KKvhb0KtBRhLr9Bft9JesEY=; b=cgGafVmvRJhV+/pREJN7C6+2ltjLcvD0crKTmyph0oRUxqql6R1NKZ7SgU2q07LpAgi/w04p3mcjfLTHZbxMq+hr6u7adCEBCRfA/L0uNqqSrKQS2OnMbz8s+IjVax1NLrSRAIai8rQaqCLioZmuYzVVXJ6Kd+ui1mObGcD3VLw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697725743594807.7751273218305; Thu, 19 Oct 2023 07:29:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSmv-0005CT-17; Thu, 19 Oct 2023 09:10:09 -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 1qtSmU-0004Mf-Su for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:53 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmT-0007Qp-E4 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:42 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4084e49a5e5so233115e9.3 for ; Thu, 19 Oct 2023 06:09:40 -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 l32-20020a05600c1d2000b00402f713c56esm4494647wms.2.2023.10.19.06.09.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720980; x=1698325780; 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=AJfJ06RDafLRLEOQTU58KKvhb0KtBRhLr9Bft9JesEY=; b=myfnfk+7mIjhUyLOgjIuqBOvgkunFxpV8p6QoSIsE90YbAFZjQFeoK3GFU26NwjV06 qbbVM3Y/lNOsLMHMbW6EgVam7EM96pzXNc/0y3G2D6L/yadkU6sGiTiQBe56oglF4kPL KMtxYaXQfEFC7ONn6Myg2yu+FSRFgiwX7sfwKZI3BRyHJcH6aG/Zmr1nmxxWD4WmuGvJ do6UaeI3q0Mo5/sbk6XPEN37VLkys/rtv9X9T0atMXnoP2f1sM1YsM+8H5VAf4tZ01P/ XyYqmQDxcHYaOmMBtZUVHZMkB6mlc2tNjxjxEF7CnslgO4YRXbUFh8WuqH/URYL77DrB Z7uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720980; x=1698325780; 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=AJfJ06RDafLRLEOQTU58KKvhb0KtBRhLr9Bft9JesEY=; b=tBIWBJULFdip63imSSJea/wflarOIUb84eNkl2WpW+1Y+9uOX180IHp7kLGptDJUr7 JCrjpzgy4AtouZxzpJGq+xi+Ne+lewzl9vSAkTjfauBSj8NJZueX8QGCsLfaesmdZBTY FmetWzEpbpSYI+bhPdtWyqZfVzNLnq3olJBavJsOJVWJqZ0Tb9vYumNhMlu8O5jaUHhX ZJebrh1a54R5+b65PI2zp1AYxjyZREkFJKOG6iq57a8YbDYI42ftMuxVU/Nvcmn8rD0w hS4cWw5Hr0I3zJZ8IgSaLzXqT8hdx8Mlbv2w9YmrGA3sh4vcW5WrFlM5nyOl0JiZZCdG MlDQ== X-Gm-Message-State: AOJu0Yw5hPbVw5WZDRDmeY/iSsj5YCInQkkbrC9Gw3NTeg3WrozdRqxc no76QzHRaYgFeSD2xSV1EnpfjUeVotSgCfcbMK+FeQ== X-Google-Smtp-Source: AGHT+IH3OEVEj+2/bUmyOQKS5bIh8d6v/vM18La9o3CPhl8cz8xCXdHyZ+0Rc+4UjdL5lzuf3JbbwA== X-Received: by 2002:a05:600c:3591:b0:405:375d:b860 with SMTP id p17-20020a05600c359100b00405375db860mr1884089wmq.21.1697720979709; Thu, 19 Oct 2023 06:09:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/9] hw/sd/pxa2xx: Do not open-code sysbus_create_simple() Date: Thu, 19 Oct 2023 15:09:17 +0200 Message-ID: <20231019130925.18744-3-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697725745836100002 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/sd/pxa2xx_mmci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 9f7a880bac..4749e935d8 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -479,13 +479,8 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma) { DeviceState *dev; - SysBusDevice *sbd; =20 - dev =3D qdev_new(TYPE_PXA2XX_MMCI); - sbd =3D SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(sbd, &error_fatal); - sysbus_mmio_map(sbd, 0, base); - sysbus_connect_irq(sbd, 0, irq); + dev =3D sysbus_create_simple(TYPE_PXA2XX_MMCI, base, irq); qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma); qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma); =20 --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697722619; cv=none; d=zohomail.com; s=zohoarc; b=PT/a/pLkqybtCthLgYv3g0eK6xOSIllYZmSnQroKwG+Spc6Z9JPI1uF/YlvX9dtngje790x0HHLn4OHhRKVYHrKCe1tMTvg8M/ngvVGONb5wnYNLEalPOR4wgurz3ZvKzFeBAOucP76buTTRHlKuFrpaFndOD5EiyVs0pPrOp3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697722619; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e3Wrm2+hEgcQGJPeHM5sv3LDR90OXcyWyLu0fpUZ2rw=; b=m6cYaLZmwNEI8TZSmJneEtL9Y9WFaGkX4qj/Kma3zEJ3r46ffc0skJ+QPJvzVbQqs5Hcvr/cKwnCLQ6dIkxHT8njfGu6EH3/aXsgLRf0gzJVE46Gsdsem3CbZKb24ok+oNUPcfZVs2Cru49W2VagzVabheCJPXn4CWCg4un/hu4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697722619969178.2078686310823; Thu, 19 Oct 2023 06:36:59 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: AGHT+IH8VKmpFMKpWsr5yUKLtS3GjfrEb3jNSIq11op5ZVpQw4bpWTJo6zuFMfsxvlH63u2VmuJxCw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697722622022100007 sysbus_mmio_map() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 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 *s= ysmem, hwaddr base) { DeviceState *dev; - PXA2xxPCMCIAState *s; =20 dev =3D qdev_new(TYPE_PXA2XX_PCMCIA); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - s =3D PXA2XX_PCMCIA(dev); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); =20 - return s; + return PXA2XX_PCMCIA(dev); } =20 static void pxa2xx_pcmcia_initfn(Object *obj) --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697723588; cv=none; d=zohomail.com; s=zohoarc; b=mJ+1cdY5FkwZB/aT+1CnfWqgHV+8D0fiVsyTnAIPH68uFwIqnJvrINqIFabo/OOUtxQ6sgnmWpsEaistGwWYNbdufV3/s0SgxofdgE1dJAXbejF2w8VsJ6MGutrqGhRKUs17w653CJmllqx0LfAB2+hCJ6WB0VBxk/g/tozzG+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697723588; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IrXKI6jVLRlYzi/YxZFiozSO1YVRsr5CmuAToS28wAk=; b=aMOiQGT1xl9W1WIlWhs03/GuuabnMvCIFtmSTVrvQi/3A11F1CsAUekJLLcspkiUUJQL5TZCEhQcvR+gI/RbWFzJQ3ccShIbJNO9d2I6LODS6Oin334oau8ijUAHn2PHVVGL/kERqoGTxhZGcFEUDGkWj2HtEWs8WFwn+C/+cp4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697723588452701.1535924017425; Thu, 19 Oct 2023 06:53:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSn1-0005Qa-AL; Thu, 19 Oct 2023 09:10:15 -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 1qtSmg-0004Nz-KK for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:55 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmf-0007l7-0g for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:54 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507c78d258fso2896871e87.2 for ; Thu, 19 Oct 2023 06:09:52 -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 e38-20020a05600c4ba600b004075d5664basm4324622wmp.8.2023.10.19.06.09.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720991; x=1698325791; 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=IrXKI6jVLRlYzi/YxZFiozSO1YVRsr5CmuAToS28wAk=; b=JahDwffL68LEt9Uk5iYJov1n9unlLPEk/J3is+0Nc19fPd1w75kQ+Kmax+XVGG2z+6 Zlu6TWtbdMKeELOhR8mXXQz0WJ1F5QGyr0r7mrbVy9ZcR5Jya8gFmrC8sOhc42Q7fiY8 W25Z+TTdj94I0j2qHBgih1NoN8aXqNqoX4bGFy+z3LbKLuEYGjS+dXEceOqp8+Ax+dpE XPP671FVDyXtvwD30+OSYvpKiOmiQrjvPSIbjzEwdQ9k/nt0dZ8qYQ4Bu/FyBIpUNmPA l2QVxGDOvq1YM7DgR2WefMA3/AXtpSYW8d1AewBbjcmZf+FjxjByOVD1rJy/471geRrr i4CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720991; x=1698325791; 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=IrXKI6jVLRlYzi/YxZFiozSO1YVRsr5CmuAToS28wAk=; b=Ofgd/GAgH+Q2BGl8N7KkEEIuEIHPXPe40JsYEfq+YdGEXoD7stZINDHZlwu1JfscTM 1pJfarSRBbUZWrlTD96i3stw/gX+vMYhXgG9NWqEFiAMcHy5uPIhg6uc3xk3ssN5u8Bs 6cz+YFFkYJRWtIhtkG7Qd7YLIa62xpKN7tovYXeVSiWErd13kkDpGkh4UxHb879tVA42 3KSLBwhXdlHvIxScVQv/GPMbGgMqcelQMx/m4r/g0J5w7Mcun4CF/BsWjV+E0KiJiw3a HezGHCjWBb8s8LUqWEKyZsJuEpSyZcKXhyvC+YEt3b0ZirXhofqXqe2ypcSs3aZSD2CH BdQg== X-Gm-Message-State: AOJu0YzXPFE814mhN4PchxvSHA3yn0741U4+jQP7moyXS5RqNtRRQxPz Lu1WqoI53FFa59diKFGzv5CTYiUKVetmxpjtMzx7ow== X-Google-Smtp-Source: AGHT+IGtnYm/bucD6PIZ9L5SiyjKCk93yo+q2A3lOYCcx7Ine6wA028rxOSE6LRiWAgRZ6YswzeNgg== X-Received: by 2002:a05:6512:3d25:b0:507:a0d7:bd19 with SMTP id d37-20020a0565123d2500b00507a0d7bd19mr1989067lfv.13.1697720990921; Thu, 19 Oct 2023 06:09:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/9] hw/pcmcia/pxa2xx: Do not open-code sysbus_create_simple() Date: Thu, 19 Oct 2023 15:09:19 +0200 Message-ID: <20231019130925.18744-5-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697723590194100003 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/pcmcia/pxa2xx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index e7264feb45..a2ab96d749 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -141,13 +141,7 @@ static void pxa2xx_pcmcia_set_irq(void *opaque, int li= ne, int level) PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base) { - DeviceState *dev; - - dev =3D qdev_new(TYPE_PXA2XX_PCMCIA); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - - return PXA2XX_PCMCIA(dev); + return PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, base, NU= LL)); } =20 static void pxa2xx_pcmcia_initfn(Object *obj) --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697725391; cv=none; d=zohomail.com; s=zohoarc; b=ETvGj07a+e4+jTu5hNw3gPa0bHgvSMtLnEszFj+tunSR7JHsB7NgZD/nQiCLthRcYJSFyav6XVqgtltgmn4LFFvpQNUOmzjdJD6UiT3oxUtoZMDRzSFZFlEt0bEacGVLEXXWB8yC5FXVN7HGqX595pB4AWxGqbMP90onImbE+bk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697725391; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kCYRI8Q1kvi4VpcB4GZtS6fXIL0c6XiuN6TOx6QUjpw=; b=Oj+edG1tXbGGmU3dWMcl/+SLekXCd6FbHNASi3oGkkXSYlvBvBHZuquaG90AvMT495s8wPkWeo0N9/9IeaNN22xHmL4r7S0Ltl5k90vXdo9JY6ppu+w15ZDMY3MCWIKOqVGLp8s4aYckisXa4c/nt6cIQu08UehmTLia5gVmOCs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697725391564358.8396613974279; Thu, 19 Oct 2023 07:23:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSmt-00054Y-3p; Thu, 19 Oct 2023 09:10:07 -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 1qtSmn-0004qZ-EA for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:01 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSml-0007lr-6c for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:00 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5046bf37ec1so10019963e87.1 for ; Thu, 19 Oct 2023 06:09:58 -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 1-20020a05600c028100b004077219aed5sm4324781wmk.6.2023.10.19.06.09.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720997; x=1698325797; 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=kCYRI8Q1kvi4VpcB4GZtS6fXIL0c6XiuN6TOx6QUjpw=; b=XeP2VzGjGC5sm1fK9s87Nzoq2buKj95HByZEIs9Jctr+TkbyFYtmxE+WEDcRILUTuC maHMhc9wLUPFTkSiRm2Gkum/YBOVa5Sf/O5fMI/2XXKmhUgEaBZDIHT6pkIbHs0ZMv5m HcG6Euz+x0VzQTyQvh9ObWCpOTcNejMmXLftlDQ3VwsfUn6E4sig8XcUqhH1v1gisE+k Y0oD1uvqcPi83Y6OnoDlm3VerffpMMsoaDibDD8KH/hAEErIcJZ6PfJ3+EwqqBPW4iL7 rBrorCy+we2cpQiDtVUK8ZH66eSMYkq/pFTT8cP9isIpxZavFuJxAIRkyBfZBeSJysFK jgZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720997; x=1698325797; 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=kCYRI8Q1kvi4VpcB4GZtS6fXIL0c6XiuN6TOx6QUjpw=; b=sg/C29TN1WtkrHZvZZU0b3/MnEebn+INTAx9ChgfQzuG5MIVmz8IV54SJ239TRMG0k LBhRN60QwZ2D9TH1uJR3l6aPXui3FrhyIBki/YcwFmeQkioDhhk7hMmN5NOe2z81EN9v j944K/YYye9gbeMZthYouA0W79mSNWi3je8udeLIfl+N9u+ftnSOxRk980WgxI6HV89c lRAASTESb/QGjKQnmIi+LN01RusDEhpdU5TRuisJLGnZZ2nc+mNx5fLZhKFUpbIOOJuZ UtlUO587A4CjRyh5VUD88BgSX+If/85N9JYDvfMEF+DhE0sRFu0/0lhK6MSBwesmbkxW wy9A== X-Gm-Message-State: AOJu0Yyh7MwDne1AmwZYDZGiwcg0K7walmoiHBCMXSsVNVB4afwW/0XX f/g3yrMo9FQvFFFdCXxS6KYmg0A7NOudpM/O6ptlsA== X-Google-Smtp-Source: AGHT+IGKqZhrC4uIaxxygIUsEn80aumRdNA4GEhb9YrxQmStgs/fpTFAeTuAeTht03bqPTfkWNEy/A== X-Received: by 2002:a05:6512:b9f:b0:507:a650:991d with SMTP id b31-20020a0565120b9f00b00507a650991dmr1840661lfv.58.1697720997128; Thu, 19 Oct 2023 06:09:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/9] hw/pcmcia/pxa2xx: Inline pxa2xx_pcmcia_init() Date: Thu, 19 Oct 2023 15:09:20 +0200 Message-ID: <20231019130925.18744-6-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697725392352100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- include/hw/arm/pxa.h | 2 -- hw/arm/pxa2xx.c | 12 ++++++++---- hw/pcmcia/pxa2xx.c | 6 ------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 54eb895e42..4c6caee113 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -100,8 +100,6 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq = readonly, #define TYPE_PXA2XX_PCMCIA "pxa2xx-pcmcia" OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxPCMCIAState, PXA2XX_PCMCIA) =20 -PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, - hwaddr base); int pxa2xx_pcmcia_attach(void *opaque, PCMCIACardState *card); int pxa2xx_pcmcia_detach(void *opaque); void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq); diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 07d5dd8691..601ddd8766 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -2205,8 +2205,10 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, co= nst char *cpu_type) sysbus_create_simple("sysbus-ohci", 0x4c000000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_USBH1)); =20 - s->pcmcia[0] =3D pxa2xx_pcmcia_init(address_space, 0x20000000); - s->pcmcia[1] =3D pxa2xx_pcmcia_init(address_space, 0x30000000); + s->pcmcia[0] =3D PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x20000000, NULL)); + s->pcmcia[1] =3D PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x30000000, NULL)); =20 sysbus_create_simple(TYPE_PXA2XX_RTC, 0x40900000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_RTCALARM)); @@ -2338,8 +2340,10 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) s->ssp[i] =3D (SSIBus *)qdev_get_child_bus(dev, "ssi"); } =20 - s->pcmcia[0] =3D pxa2xx_pcmcia_init(address_space, 0x20000000); - s->pcmcia[1] =3D pxa2xx_pcmcia_init(address_space, 0x30000000); + s->pcmcia[0] =3D PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x20000000, NULL)); + s->pcmcia[1] =3D PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x30000000, NULL)); =20 sysbus_create_simple(TYPE_PXA2XX_RTC, 0x40900000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_RTCALARM)); diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index a2ab96d749..e3111fdf1a 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -138,12 +138,6 @@ static void pxa2xx_pcmcia_set_irq(void *opaque, int li= ne, int level) qemu_set_irq(s->irq, level); } =20 -PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, - hwaddr base) -{ - return PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, base, NU= LL)); -} - static void pxa2xx_pcmcia_initfn(Object *obj) { SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697725057; cv=none; d=zohomail.com; s=zohoarc; b=MbKH9OpyEfFJf5/V+5eSl3c7yvIHEj5mRvrpHMNdlsNGFpVCviK6ZqjmKy77tWTpAkRA6ehWSQ9Mao/KxjENYdywj9Dq7w4tjt+5Sb91rpV9TmVvkvyE2mBbWtT096L3stP1ZDxBVI17dkLdUYzdLSfjctKPX3bOaxkxLDd+rn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697725057; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LSmy0AQ2ctzt4sBy/4+sAM4ntN11b2Cq/iHR2Msv118=; b=ReRhMJLRfJvrdSovzUnb0BLQtzfjRTxyydqHmeKL76tAiLfbBfWllKeA3rBaV2iwvYyaIM7YmBueOKh+exV+lyH+1kRbbynGr9mT2RWwKshnU6ZAfxCmYCxWTMxXct8milxLJH9eQ71keS3yU+YV4lhUDCvCNlu5Z5uGFWOteyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697725057623632.9235307553977; Thu, 19 Oct 2023 07:17:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSn0-0005Gu-Hz; Thu, 19 Oct 2023 09:10:14 -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 1qtSms-000558-MA for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:06 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmq-0007n0-P8 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:06 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50797cf5b69so8474347e87.2 for ; Thu, 19 Oct 2023 06:10:04 -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 bt14-20020a056000080e00b0032da4f70756sm4518629wrb.5.2023.10.19.06.10.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721003; x=1698325803; 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=LSmy0AQ2ctzt4sBy/4+sAM4ntN11b2Cq/iHR2Msv118=; b=qkr/v8nXIhz3SoD89Vr1W3sHlI/AXRfkyxtWvpdpwmBXUJYqE0igSD538JhtCDCkmH VKuwEPjOCELSOW0Zzbv+ZaF0SsCBB9DK0UehHrz6zPQPSs90XrOr13vZSLckpqfBkF28 5PSEviougYHkfPxPnxaP901dqXAKaScxh7yT7eVSW7+BDFfvh7wvuH2hMivvPggmLh7D +8YV5R/tRkbT+gL/Q8zVXq4JGOBWrsq8cI2VnrdDOsshG4znZrhaZBPNUUrjETme+nlG HMWSLCrnUn5bnWH8K+8UMcFcCOergOPpT56/MTEKjrNlI0iBBAuhaGwtPbOWroUr4OBI Y+tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721003; x=1698325803; 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=LSmy0AQ2ctzt4sBy/4+sAM4ntN11b2Cq/iHR2Msv118=; b=MhRjBUWcIvauVI8cYNSpetH4bxwOQ8C0ZKEsu6xrvnqzA50cKCR0ANpnupGeqPfLXu ig9+XueZ8OwYUA7aWwThE7i42mq+qSSWnKQ1gkRnmXUTXu1p11gjFGchSQP+JKA2VtkC zQBgJpdtezVGO05LhAcbYir+mdngrwMuj0U1oajZ6ajP3QPZAjJWGR90hwi6xAhFpwfK o9J60ZRFeXEFTiQxB4ke0mQcd38fFFGvTw0SeYyYxvMbSrwTX07PrmWQnXV/ldvtpCwe 32FZa15+EjCZ7SMutPYU0v109xXEtARA66vTW7FJ8Mc92zUC9yGFsP/DxbrX13zx2xYo oaeA== X-Gm-Message-State: AOJu0YzASH5YBUbcos01WpIcFFrLHcYRA8/+PFxpAF5Kn0SEZowzYfk8 Hm6by3pWaNGENqn3xoTTuzIYnNDgTgEzGo8CngMxTw== X-Google-Smtp-Source: AGHT+IHJIUtLhRXD0auV7zNUFTyWmKx+Y0Cv9FaRsuyLBGRXNoKwf/U4fwW4KYid+DiY6wrewG6fNw== X-Received: by 2002:a05:6512:701:b0:503:655:12e7 with SMTP id b1-20020a056512070100b00503065512e7mr1356840lfs.62.1697721002787; Thu, 19 Oct 2023 06:10:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 6/9] hw/intc/pxa2xx: Convert to Resettable interface Date: Thu, 19 Oct 2023 15:09:21 +0200 Message-ID: <20231019130925.18744-7-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697725058907100005 Factor reset code out of the DeviceRealize() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/pxa2xx_pic.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 47132ab982..2eb869a605 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -271,12 +271,9 @@ static int pxa2xx_pic_post_load(void *opaque, int vers= ion_id) return 0; } =20 -DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) +static void pxa2xx_pic_reset_hold(Object *obj) { - DeviceState *dev =3D qdev_new(TYPE_PXA2XX_PIC); - PXA2xxPICState *s =3D PXA2XX_PIC(dev); - - s->cpu =3D cpu; + PXA2xxPICState *s =3D PXA2XX_PIC(obj); =20 s->int_pending[0] =3D 0; s->int_pending[1] =3D 0; @@ -284,6 +281,14 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) s->int_enabled[1] =3D 0; s->is_fiq[0] =3D 0; s->is_fiq[1] =3D 0; +} + +DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) +{ + DeviceState *dev =3D qdev_new(TYPE_PXA2XX_PIC); + PXA2xxPICState *s =3D PXA2XX_PIC(dev); + + s->cpu =3D cpu; =20 sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 @@ -319,9 +324,11 @@ static const VMStateDescription vmstate_pxa2xx_pic_reg= s =3D { static void pxa2xx_pic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->desc =3D "PXA2xx PIC"; dc->vmsd =3D &vmstate_pxa2xx_pic_regs; + rc->phases.hold =3D pxa2xx_pic_reset_hold; } =20 static const TypeInfo pxa2xx_pic_info =3D { --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697725244; cv=none; d=zohomail.com; s=zohoarc; b=OW7RtnNlRz93t2qaPBxkZAeBFvfaWZ3JwntWjJ4wMcJ3zRSSR1WfWjRzVZ3QvnS8n8sLQEud7qZY30uJfqT/+20DOd9dQgyAZGvjjjVSttYsJk4prP2omHCGdwfX09b3H7cF0Z7uzjP9VlanWA7K9+10AbsbYq8s7Alb6TlSvf0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697725244; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=naln2KbxTA0RZlZ2uPobiie6+dLymtlbvgeZgA+WSH8AQ/4SgwJxISa3FiX1xkV6/K89vInpahSxFFEKBy9+V0QX5G4oD/ixKGiKUaejQu//A+E18/eYjtIZX+eqFUioQIW+qq1tzfWLZB06YN6/XAKmeapVO1D1lVpNgzCqO68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697725244889103.47817853153356; Thu, 19 Oct 2023 07:20:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSn7-0005h6-LS; Thu, 19 Oct 2023 09:10:21 -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 1qtSn0-0005OE-30 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:14 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmx-0007z8-QH for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:13 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-406609df1a6so72834785e9.3 for ; Thu, 19 Oct 2023 06:10:10 -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 r16-20020a05600c459000b00405391f485fsm4456618wmo.41.2023.10.19.06.10.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721009; x=1698325809; 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=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=RWD6Xe2o+7QqJPE/q0O/ioZ6oa6/FeioX42H3ci+ZkC0xlXqvGcWUdZPtG6DohKyMM 4YXeJ/ZyYJcXuxV6Y5ANEfh1Sw/qDjFkvcpMk67/FfQDC29D31VHzpnFrGCfowrKI7BM DdVxZEetBnixBT1MLTp7waEkZ218k9hZACsybrywvFrjReWYGhNVTjjirNJWU6DUzwQ3 iKjj1szTRt7THElIGZYDXPxe5vRSjNRY34IDpCFGQIasITr6uWGtlX5mAbcxhrNe7/Si IJKKSscCj/qxnuJ71sudOtkctqbuaozrYKo7eFD1BYlxu1kibz4mggJMFNgu+5ltpHSK Ch3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721009; x=1698325809; 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=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=LW6m9ZdOV8a5A8kqw7Anu+SjIlNbVrH/Q5O+eqr0TeMNncvj5cN8eKdpZuVVHMBA7w 50tDYUIVjyc1IpnU+jqPJaaD0+ronBiFx873rBVLMB8k+ylD8xsA2dxLc90Ow654eEqS a5jnxOwaxFM7V1tnb0t08vQk18oB3UItKe+LnbwVgN5E5a5mfjYsjZwY4+hdM3QuHG0k Vw6M28XD2vnBUqSCLbThN3UFsIICSvrYcvIXvw14o81hx+Ra0ON73cdGBh+hyoT2FpXF QC6SpeL8YSN/UyMhqI/qUWNdPZTAeuLwuSRUKoOprjwMXpuBLRS2Ew9aos8uqwl9mzSW +7FQ== X-Gm-Message-State: AOJu0YzvVlc5M/qS3qjGvEMzouI3lpoMqytCkLxx5ZZYbpu6N/I4hv17 6VmdKfx7h0vIJxTPzs3ZA6mSW3mMuwsfuX2AsV2Ycw== X-Google-Smtp-Source: AGHT+IGguIz8HbEEBSOgkoYgF/ZH0ySW9aMvXrUwrP1ergEhLHkHT1zMRiSJKeZZiU21k24B/gca1w== X-Received: by 2002:a05:600c:a07:b0:408:3f64:6553 with SMTP id z7-20020a05600c0a0700b004083f646553mr1746777wmp.16.1697721008600; Thu, 19 Oct 2023 06:10:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 7/9] hw/intc/pxa2xx: Pass CPU reference using QOM link property Date: Thu, 19 Oct 2023 15:09:22 +0200 Message-ID: <20231019130925.18744-8-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697725245812100003 QOM objects shouldn't access each other internals fields except using the QOM API. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/pxa2xx_pic.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 2eb869a605..7e180635c2 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -15,6 +15,7 @@ #include "cpu.h" #include "hw/arm/pxa.h" #include "hw/sysbus.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" #include "target/arm/cpregs.h" @@ -288,7 +289,8 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) DeviceState *dev =3D qdev_new(TYPE_PXA2XX_PIC); PXA2xxPICState *s =3D PXA2XX_PIC(dev); =20 - s->cpu =3D cpu; + object_property_set_link(OBJECT(dev), "arm-cpu", + OBJECT(cpu), &error_abort); =20 sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 @@ -321,11 +323,18 @@ static const VMStateDescription vmstate_pxa2xx_pic_re= gs =3D { }, }; =20 +static Property pxa2xx_pic_properties[] =3D { + DEFINE_PROP_LINK("arm-cpu", PXA2xxPICState, cpu, + TYPE_ARM_CPU, ARMCPU *), + DEFINE_PROP_END_OF_LIST(), +}; + static void pxa2xx_pic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 + device_class_set_props(dc, pxa2xx_pic_properties); dc->desc =3D "PXA2xx PIC"; dc->vmsd =3D &vmstate_pxa2xx_pic_regs; rc->phases.hold =3D pxa2xx_pic_reset_hold; --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697725247; cv=none; d=zohomail.com; s=zohoarc; b=CwQou/KLTol/knNGu7wTXo9XnWt7Qpssxg/QmceSnkfT7SE9wTcGwQ78JOERi+A1uAotRQdx5RnN3OIjfhrLBd6EMq0Zrmg7WR4LqQVQ8GQfZowsPR7lHABIMjhzuk/A7q8GkxFhhka8pk+dUv8++H38iQBYhZjULbhI2FUB1iQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697725247; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jWeKlxu/1oSXjew02PYYb/4LgtdqaZA73Poob6GIouM=; b=LCFN7X6Qzs82Y0SR/jMcVDNvKMhoqVWuGW22RPp7A2wDNS/fbWIcAi/tQyL3UuAxArjdoD9ca7CHe1P4e0pEG+tLZOmfxR+QiE1vnKnyKEG2SfDbsq5oe6xX1ccm7WSK8yYwJARVMvEnDLgb7LEYGiPyR5YKRJlHbIpgoGoBb5I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697725247462824.2494628832148; Thu, 19 Oct 2023 07:20:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSn7-0005h9-PQ; Thu, 19 Oct 2023 09:10:21 -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 1qtSn5-0005dJ-BD for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:19 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSn3-00085K-6K for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:18 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31f71b25a99so6853312f8f.2 for ; Thu, 19 Oct 2023 06:10:16 -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 l16-20020a5d4bd0000000b00323293bd023sm4461613wrt.6.2023.10.19.06.10.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721015; x=1698325815; 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=jWeKlxu/1oSXjew02PYYb/4LgtdqaZA73Poob6GIouM=; b=RkTgFM8fg6H1DlCEBPBowU4aLivDDNyXf1c5QGyIjjhldO98ezgd4C+eSURS5cbq2x GNlifTc+fazdYfAN2tl6pg4Y6aATiEg1aB/WgWVSnvcDtBOs67QwfI1zmRmTdJJOQTEZ gVRycj/9Arw6t6JiBD2W6fiY0hdXJ/RqZPrmVnm+ckae9f+BuPh3Rv3IJ7ZnKQ5o+hDA PVXXm1Ur1K/Bq1QlZr31e+ekpwfT8PB34JLnBxlImHjqeULKyzWLFBbBlh59AMEkvrLJ vTHez2BNCHCJt73c3j22DDoRKXrjaw/qFtBpzvqK5+GnMC39lWmXUGnhZwqwXWtDzAPQ VgOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721015; x=1698325815; 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=jWeKlxu/1oSXjew02PYYb/4LgtdqaZA73Poob6GIouM=; b=ITePQk8wBGmHw/tB+NNXr4lzfM0dSnA666aa/gOVtPjLqZEW21kYZGZCeUYpRUhBtp u6//nyvD2Qk7riToRKFxi+lLXMnySG5AIoe8kQPOyc8ER6Q5ivNje785Aw9YZY7kStOc /PKLPO6QB6dcd4DhZY35mw6eNhNzjYEPU6Z1uooYyhaH5mSjZVpZ3JPFpisTLp4fExp4 RoH8uxaYPLsjoyExgFQzFdtsqrH49EzAIdUgHyVQItf8dRs4SVd3d3qrPPkuqk+Qa4Ti 5d03zlYMP9vOQvFANE9cD4jz9uTxCA+woO8p6XlBur2V3yEuENfwdMGx5LuWTqUn74fT Xytg== X-Gm-Message-State: AOJu0Yze3jkCoi9eyd3Pz2MY40k0DWi6e3WmNn8CLNOzd3kfWNdoDQ2I xUzOKBi5/T+f3FqHh67c4hOn1OmN/SSsiLM27AVphQ== X-Google-Smtp-Source: AGHT+IFo2GfT0l/Czer8nhIUVi1v8USqPk+tannTVKC/RkXgHd0jmsotxXsUqZsYqLSvDCMRCfDGLQ== X-Received: by 2002:a5d:66cd:0:b0:321:677d:98b0 with SMTP id k13-20020a5d66cd000000b00321677d98b0mr1477106wrw.11.1697721015193; Thu, 19 Oct 2023 06:10:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 8/9] hw/intc/pxa2xx: Factor pxa2xx_pic_realize() out of pxa2xx_pic_init() Date: Thu, 19 Oct 2023 15:09:23 +0200 Message-ID: <20231019130925.18744-9-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697725247742100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/pxa2xx_pic.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 7e180635c2..1373a0d275 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -287,12 +287,18 @@ static void pxa2xx_pic_reset_hold(Object *obj) DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) { DeviceState *dev =3D qdev_new(TYPE_PXA2XX_PIC); - PXA2xxPICState *s =3D PXA2XX_PIC(dev); =20 object_property_set_link(OBJECT(dev), "arm-cpu", OBJECT(cpu), &error_abort); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); + + return dev; +} + +static void pxa2xx_pic_realize(DeviceState *dev, Error **errp) +{ + PXA2xxPICState *s =3D PXA2XX_PIC(dev); =20 qdev_init_gpio_in(dev, pxa2xx_pic_set_irq, PXA2XX_PIC_SRCS); =20 @@ -300,12 +306,9 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) memory_region_init_io(&s->iomem, OBJECT(s), &pxa2xx_pic_ops, s, "pxa2xx-pic", 0x00100000); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); =20 /* Enable IC coprocessor access. */ - define_arm_cp_regs_with_opaque(cpu, pxa_pic_cp_reginfo, s); - - return dev; + define_arm_cp_regs_with_opaque(s->cpu, pxa_pic_cp_reginfo, s); } =20 static const VMStateDescription vmstate_pxa2xx_pic_regs =3D { @@ -335,6 +338,7 @@ static void pxa2xx_pic_class_init(ObjectClass *klass, v= oid *data) ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 device_class_set_props(dc, pxa2xx_pic_properties); + dc->realize =3D pxa2xx_pic_realize; dc->desc =3D "PXA2xx PIC"; dc->vmsd =3D &vmstate_pxa2xx_pic_regs; rc->phases.hold =3D pxa2xx_pic_reset_hold; --=20 2.41.0 From nobody Wed Nov 27 14:35:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697725010; cv=none; d=zohomail.com; s=zohoarc; b=ghsoMuhm3ViQybaj6T9kNSIOkpy4Hgv1agI0ZAg6Gg6zBHR22pwLuzAhCfSG8xr/Xdw7BBP5p+maZHlMkDS5g0GuX3p4a7xUIfwzTLL8l/yxqOuWY4VCOXBbbkIOMaJfQrUa2lmQfKsgQIihGQCSeSdNCSW5Hz+WwS5iCXGydLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697725010; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7XHyEIGArD78mgw8R7PN08IB8dbr9alKW/qdS4/dSAc=; b=N8p0s9JeAmBpHMQpQiQe1mCQmWkblIp+ep700CtmXVHHJ65pHzks3MF9QtCorrKXCV0conLOJHsq+5Uxnw3DkG3pO2caAD8+ZCz9eaEQpOLzp8PvVfUWavpE5mfVT5SWAgeWykN6DZ0+M0HVb7pqn+QslEtUlms14j9JoPDBzUQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697725010735149.94911208339522; Thu, 19 Oct 2023 07:16:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSnE-0006KV-NT; Thu, 19 Oct 2023 09:10:28 -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 1qtSnC-0005wY-1u for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:26 -0400 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSn8-0008ED-TB for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:25 -0400 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b95d5ee18dso116091921fa.1 for ; Thu, 19 Oct 2023 06:10:22 -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 p15-20020a05600c1d8f00b00402d34ea099sm4421837wms.29.2023.10.19.06.10.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721021; x=1698325821; 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=7XHyEIGArD78mgw8R7PN08IB8dbr9alKW/qdS4/dSAc=; b=tTlJfgfFTTti9T7ef2mjZmwlgwquxMQHtMBIfvTBQPlHRKPiaZIc3HTOU6opKGCJdL Inbe6F7veaVsjcf09k0wNWrDA5zj70/uFO0aauYPVYXW0TM4MtuzS+YxyDqJeQFWR64E ImSFy7CYO/gle+5yJ+C0CGaTNEtl4SSa0ITq4LfvqlkrZyzJApMFR4dHBPNvHSZfN60q 6hljErKdy3oio3Vyu3Th2hVhBiYrl3ZbX6fYn8btEIqTED6Sm6HJ4GGdwqthl0y45g+4 BhGRDWk2CWqdmJyGMRsv/LcweeSj4kbJw6tINhiQObzTNYkc9rt+8/eBcksakjLOiFYY EGkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721021; x=1698325821; 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=7XHyEIGArD78mgw8R7PN08IB8dbr9alKW/qdS4/dSAc=; b=nvsYoDhuJpY05Y4qyY5SEjNpaA3khd1LsqkCT4xlrU6XwHEJ7DI0ly706/bR1OjjYW 6Xmh0+2X5dgm+JBjaRAcQ8x0eZRdvCfEDGy62FD989IQeddy5hhxuhoI+scMV+U8ZZhr lCbt4DLxA8M8tH6NuSWlKjR89/sblEhSZc7bXigiRFFQTYDcvXe+qAgU0N9rbb5yGiUw FKQln+9dZnxJ09c90aiqPR2G8KxaH+cpKcfNfOP75xd+K2B8uTEn7HJtvwAXvTiRSh6y rskFZpkGf26KslFA5UuU8Wmd8zq+N+vrdemOv+RtpAQtH22O+l8J07WsWki4N8XP/ATH Gr5A== X-Gm-Message-State: AOJu0YwWtEbGgTsUXyOqzQm2FQ9lRthWMov5lbGcl6b66lscHY7z++M/ 86Y3D9hbd9OgnOPxRHKC3r64S+UYn4tVFDQlcLEegw== X-Google-Smtp-Source: AGHT+IFkqkGK9Gt2O8cUoe+C52M46/qI7NN2msK2Fns5hoKJdI4Bno2716qQSEMgZP2HSAMDUZVZMA== X-Received: by 2002:a2e:b601:0:b0:2c5:1a89:41c0 with SMTP id r1-20020a2eb601000000b002c51a8941c0mr1329995ljn.23.1697721020837; Thu, 19 Oct 2023 06:10:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 9/9] hw/arm/pxa2xx: Realize PXA2XX_I2C device before accessing it Date: Thu, 19 Oct 2023 15:09:24 +0200 Message-ID: <20231019130925.18744-10-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=philmd@linaro.org; helo=mail-lj1-x22f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697725012742100001 qbus_new(), called in i2c_init_bus(), should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/pxa2xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 601ddd8766..f0bf407e66 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -1513,14 +1513,15 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base, qdev_prop_set_uint32(dev, "size", region_size + 1); qdev_prop_set_uint32(dev, "offset", base & region_size); =20 + /* FIXME: Should the slave device really be on a separate bus? */ + i2cbus =3D i2c_init_bus(dev, "dummy"); + i2c_dev =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(i2c_dev, &error_fatal); sysbus_mmio_map(i2c_dev, 0, base & ~region_size); sysbus_connect_irq(i2c_dev, 0, irq); =20 s =3D PXA2XX_I2C(i2c_dev); - /* FIXME: Should the slave device really be on a separate bus? */ - i2cbus =3D i2c_init_bus(dev, "dummy"); s->slave =3D PXA2XX_I2C_SLAVE(i2c_slave_create_simple(i2cbus, TYPE_PXA2XX_I2C_SL= AVE, 0)); --=20 2.41.0