From nobody Wed Nov 27 15:31:08 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=1697807113; cv=none; d=zohomail.com; s=zohoarc; b=BUefibwXuy2J/JdD+atKoqwVfhsDCIBMLFIuKIuQ2gmsHWvQRi7/vjW8NF3+9UxSFssXYDtoI/9LgWRGrWNkVc8KLS0spQneCs4w7CEu+QoDn0H9ZcngxXptIArR6vtOJQcm1rDmmuCJrzynSNjl59Z3+HDtnof/4o47pyLAvUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807113; 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=j7mClc/LVpV4WxhBVsV429+V8CLaLMPjHNY4x1KwfS4=; b=giNkC1Jjwtp43H5xBfzHERc+d/2s55uuoDrKIjc1BCT+EwuNSgmFAKGGoCcK4x3PohkL6o1o7FVQrntaVidRhmpk83ErHvB4qEyQkYnMMn2QL3R7q0HS/2Cem9NkvL2K5l5L3uUE6eNujMMpYjtcep4wCwH2BIr7zowzF0D1CXk= 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 1697807113709518.6168246607077; Fri, 20 Oct 2023 06:05:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAK-0000Fd-Kj; Fri, 20 Oct 2023 09:03:48 -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 1qtpAH-0000Es-M7 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:03:46 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAF-0005Fn-Vg for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:03:45 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9c5b313b3ffso122759566b.0 for ; Fri, 20 Oct 2023 06:03:42 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id f26-20020a170906085a00b009ad8796a6aesm1454419ejd.56.2023.10.20.06.03.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807020; x=1698411820; 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=j7mClc/LVpV4WxhBVsV429+V8CLaLMPjHNY4x1KwfS4=; b=F26q20g1TgPUCF56MHKXbOwhTHzuhOBmxQ8CZdXZhKODaqrC66aYi8bSQR0/ZFoKMT um4l5dcYdyr/hnuBrO30prSEW5M3u1rJSlBXzPGWvTNtjXvhuoAfFQdJjbhc9tV3GoYW FHQSAhTrMtRmO9W0V9GUGvFE45x4i6uJf/J4QNX56nZOgPZ3E1/72cvjB3YNmqueP35Q KNa6CqHNXvHY9a4tFcZD1cJ6WnZqK9RL1ccZGccxpo3atjG46KgrNUlHqOftvWxBYSch WYatl4vnNM06C9qSvGE473V9Gbi+rozL6hpNrIt1VSreBgMe2RhUw+WK4CwhSyQf+t0t j4bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807020; x=1698411820; 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=j7mClc/LVpV4WxhBVsV429+V8CLaLMPjHNY4x1KwfS4=; b=lKA6Rd66NlEE6TOp1bSh09dvEu9johIQS44xuk/WjwZlMMC6dGvRhmDBYT6yzXR7TQ QthhtZExEcp5N3r8pRwYzBqinPn86z6OeEfoUpOSLIaWTizCaLQmr65G/sUw8iRn3FWM XoPVN+UO5hFEAeymlKH2mdqE/AbZEo6fz+5MPZfR3178iWvRTker8Ci0HHzrOu2jlHSn liKczUerbXds79IwmFMDjEDk2siDYPJolAjwK9BvvsEjMHLKm4SfG83Wv5Rwh5FMu9Xb FeBlqgmz2YVi6MbwgpfmM1t9K7vmMSImC8RT/68rZ+LOEkn8+I1djDIVbmuZaQ37ZWgn txUg== X-Gm-Message-State: AOJu0YyJve+KkzpBJDDpzelk04u3UfS8tO4tyXG93F0r0o8f/ksLvcVx NAb5Dtt7ee+Vgf/CnCC9AnQ/D8GFiF4sD/IzurU= X-Google-Smtp-Source: AGHT+IFpLaNaE4vz0GbwgYW6AqWqMhHqXlj83S9U6W3rmyvbjmydIjSrSmKNrTbKWh/vQu1LQZw/UA== X-Received: by 2002:a17:907:26c9:b0:9c6:287d:c59d with SMTP id bp9-20020a17090726c900b009c6287dc59dmr1485002ejc.28.1697807019858; Fri, 20 Oct 2023 06:03:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/9] hw/sd/pxa2xx: Realize sysbus device before accessing it Date: Fri, 20 Oct 2023 15:03:22 +0200 Message-ID: <20231020130331.50048-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.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: 1697807114889100016 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 Reviewed-by: Richard Henderson --- 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 15:31:08 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=1697807111; cv=none; d=zohomail.com; s=zohoarc; b=fMXSNi8leXrcDqXQ0LpFxUtUF6O96A2iJCjE/a4gbs7nqeQEw+liKJSEqmU765GV/TVS+Hrukk0vPxuH8/WKtUX4NE+mJjg0iC8OszOK7yN2URCA+k0dQWt3oiXTJ5q/T0p12Cijc+XDIES1sCuHTKfj9HEGYCiNWuCG9Sr9OyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807111; 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=zkM/85hWmZ9SV/FNcYSH0O2+Ai96FulzN3LwQBfEAtk=; b=L7CkpyZI7xt0vVYvk637ug6F38OstImJP514JLF3jstPNbGU9Se/Trcbuz4xgGFDJxn0ZM8KKUa+pJGOvhH6n23XGlj5jtp3ml/RSMpdiMDWOOl7BfpMU7NVu47PaTkiOdexoVrnV0ElZeVRJuyyHGAK6dcJkfxUGQ2EUcd5Vkw= 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 169780711134964.69681330074309; Fri, 20 Oct 2023 06:05:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAP-0000Q0-OZ; Fri, 20 Oct 2023 09:03:53 -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 1qtpAM-0000H4-LL for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:03:50 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAK-0005I5-M8 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:03:50 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9adb9fa7200so177212166b.0 for ; Fri, 20 Oct 2023 06:03:47 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id lg15-20020a170906f88f00b009ae587ce135sm1452393ejb.223.2023.10.20.06.03.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807026; x=1698411826; 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=zkM/85hWmZ9SV/FNcYSH0O2+Ai96FulzN3LwQBfEAtk=; b=fz0NQGU9471iYg4GO3VbOIPLGT9uobXl9GyUpEDQYX6fPwUXO9wWJx5rHb9iIZj2/a 7t8L+KCAhofo0UmDlkanyNd6JhZxUM6ag+rrYfivzUpSwrPz4vF7jiCQMhPIhbmnMMc9 lSlvHUkKPmQGt/1ditwzusqn363BvpA1aiKv1xH5ZUskJJ/DwBL474XZ4l5Qxj+Kk0qF a3/G4Em1s9p/s4A7Nd7MgWHyF+7xWJRsQ+RQyWJ9mbQwOaK4WScHBy30MKF1B7hFZos3 YmKBcogPNcUJl7RZK8nns6di5Z5G0Jko2I1siSeevHn9suBhC4FsdsjWbzJgwI7y0P71 5ZSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807026; x=1698411826; 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=zkM/85hWmZ9SV/FNcYSH0O2+Ai96FulzN3LwQBfEAtk=; b=PT8DnIn/w4tNdl02eqsRaK8Kj1gvB8gGLzP8KYTbArP3CTHrzhr+/7oE/y+7Hu4Qv7 l3xqkWQHNJ3N3NEJhhqV/vdaV+m1Y+/F2oRY1lVgDp5hRgscKZAso2zei5Ny44zWCwVQ 4MuHi7DNB2HDS5+bUrNpbHu2a9XDRTpQjxYK53iZfspp1ijdnKzIQzo1zQ/Y3Nrjf/oL tl+VNZRZfCdtVOTzqFBxmkJZcmVOPhHuwHk+V7aVjTI/a9VG8OhdvqndXa6EditCNa3L RoCmRZ8mDmsJLH0VOADJvipv3d5E7F2KpLooizddgpmIs9GE0OYltJrqGa3k2jbCc42L 25Cw== X-Gm-Message-State: AOJu0YzOS0LRy5bwsqv3NCOOgOmRZkFeocP+gHfr4khTNHlo8BDxrkKt ZQabrYtS1A80b7eRA7ny4nN82rrbnZnmXb4W40I= X-Google-Smtp-Source: AGHT+IF4lpq7yj1LfgbMnKPc7grhVqGQH88JdhNtSSjJtDx7+CE7PtarxBggqZyVezhvLox6h7p6fw== X-Received: by 2002:a17:907:868f:b0:9ad:e3fd:d46c with SMTP id qa15-20020a170907868f00b009ade3fdd46cmr4254879ejc.10.1697807025923; Fri, 20 Oct 2023 06:03:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/9] hw/sd/pxa2xx: Do not open-code sysbus_create_simple() Date: Fri, 20 Oct 2023 15:03:23 +0200 Message-ID: <20231020130331.50048-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::62a; envelope-from=philmd@linaro.org; helo=mail-ej1-x62a.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: 1697807112904100007 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson --- 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 15:31:08 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=1697807113; cv=none; d=zohomail.com; s=zohoarc; b=HCLxCsBILwh8C5xjpAZ30mMlRuHKKY53go0kL+NZdqLZyi96wiGVMsVvahi8V/R41eeNFKTzg1ObSyF8QT/oS4d3Dw0nOMIf5iyIEa04Gr4Q2s5of7N8peH7iMlZbFiGP5BaUxQon4nmTI2IK9a9Fu5PARwgB0eisW9Q4BfToTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807113; 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=VvkfRXdPjwZ/XLZmVrV6N6IqteNQI6rI35LT6QBMgTk=; b=HI2ss5oZT1G3R6uO4Ts1CZ5h6ZvhIa3PIPD07uMIGBV9rKYVMjVt+IDGS1NUsJv/Huew3/8xn4BTSCaPsfs6k0ZCrTCv91SBurGuY2DJwU3jdvIpOWvXRKC6xl6qgqBi96fNQHDaWDbh61KRJjKeGVl5BkDIiN8xgoPoAjyz+Wc= 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 1697807113791615.9932538060817; Fri, 20 Oct 2023 06:05:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAs-0000uQ-4K; Fri, 20 Oct 2023 09:04:22 -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 1qtpAV-0000gr-Pv for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:05 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAP-0005Iw-MI for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:03:58 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9be02fcf268so120804766b.3 for ; Fri, 20 Oct 2023 06:03:53 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id j12-20020a170906050c00b00977eec7b7e8sm1474283eja.68.2023.10.20.06.03.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807032; x=1698411832; 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=VvkfRXdPjwZ/XLZmVrV6N6IqteNQI6rI35LT6QBMgTk=; b=yDVvaO3DVY4OzZlGv3c9ePTIEw+jlkjRZBltkcoxAWrV3Lfl0jp9MYTk91cDFNww45 a/vOljD97KW3biVxE1EHabSBZspZEO0ZT/2CzOpOs9JgUJAjrXnnwNiZpGFo7oWwowvG IO6oi49jYb39w6KfFlRS2Rodlr573boO3f453PYz6gFINSdfzCsXXl0ZGT2X5EYennmS pl6sGRAKVvDA1hY9YlsgQ3c7Uczu4h1fI+DbbtrprVvYoEE8Srp0DXjA3bwj8GkxC8mA XPOCsTbDBM3CUZ6+WASRi7n7z5PVt5rm6W52HkGgZ7V2pPHDTcdmn4qJvW+gn2SyZ8Ur mnqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807032; x=1698411832; 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=VvkfRXdPjwZ/XLZmVrV6N6IqteNQI6rI35LT6QBMgTk=; b=pE+7dGOQFIfiW3kimSDAM4t6y/yBbbMnSHM2gqcFEZeGcVZn4rzl/BYBCxSFkmDAyy 9sQjHLLOGZFQ8doZBcz2eYa86QIPDymK0dWSZwJRXP58d9fXUp+1PBAMUKroP3BOel56 yOHheO/SyN8lnLJs2rtWKymBJgzeJrW/XqIjKuGc1lV9j7qjni2HpOelV7EobrzyPcr8 I8ArldCkAXuSlxlKJ6OoHuAdRBSGjCNJ5QPk10YYvztP3VMyx9cCthPHzyGpdrDsQcLM IfA0OuUwlY/tuQ2WFgVuVdME9ifre0y8ja6mhvI6QC6syE9g2K85ctfs/VP9nx4uOzDP WS2A== X-Gm-Message-State: AOJu0YxazWkhPvkcjnPtyLvpDuWv6FAmTsAKA+rXYH3gCDjlU1tE94F0 V4z4e1b4cXd9sCtQdZNfcM4PvvjZbTMQrD5BVLE= X-Google-Smtp-Source: AGHT+IGFq077xUkEch/+W/x3EqvNAm2NAJUbzAlawmd0BXCG0vkaTZbZE+P/h+nCv+N93pVXyoMHFQ== X-Received: by 2002:a17:907:d19:b0:9b6:550c:71cb with SMTP id gn25-20020a1709070d1900b009b6550c71cbmr1132082ejc.52.1697807031911; Fri, 20 Oct 2023 06:03:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/9] hw/pcmcia/pxa2xx: Realize sysbus device before accessing it Date: Fri, 20 Oct 2023 15:03:24 +0200 Message-ID: <20231020130331.50048-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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: 1697807114889100015 sysbus_mmio_map() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson --- 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 15:31:08 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=1697807173; cv=none; d=zohomail.com; s=zohoarc; b=Ht4HuQCx67g7rIktJXAPEBkZpYPLeU3xnqCEH2wkX6kX3jnc0H41zQF5P+EsGW7UcnxM40Vns1Fr8fsSI9kDI5YpS3f8YJujdWkUBotrC7mtKeeD7KsA4XCS7rRaU4VyEcIaE6N9nErT6pPMgyc3uX+MAO+eVGoRxWrv6bFzSFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807173; 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=qVpVhfYsMArn5+3t2ZWXwVgzj4H5ByX4fZEF0dWkMj4=; b=YMMurGuZpaY5szmUdpwPtHVGOE/k9sGUOqAzr36ND6t6WwCu0LbbkdkFtQCylFKzVylmN8gcpVj0YE0ETmJbZIPjMMe94n3WFVzqGJVjKIDUdv1hTArdAHd/LNvCYhDl7m/laBAtQxuSpwHOPYw6KuiBbwDorD2wPFIJP2RpVFc= 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 1697807173081102.24317293910997; Fri, 20 Oct 2023 06:06:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAt-00019f-5p; Fri, 20 Oct 2023 09:04:23 -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 1qtpAZ-0000hL-QR for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:10 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAX-0005K4-SB for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:03 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9b96c3b4be4so121593266b.1 for ; Fri, 20 Oct 2023 06:04:00 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id my18-20020a1709065a5200b009a9fbeb15f5sm1447874ejc.46.2023.10.20.06.03.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807038; x=1698411838; 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=qVpVhfYsMArn5+3t2ZWXwVgzj4H5ByX4fZEF0dWkMj4=; b=pDh492T0LIHfqyFWzMWdCkOe2e5VCyI6wjvYCJ1hnXWIQzVhBvHoi4OhSjtyO0NZXy xwi2tUgYe+PZETFDCKjCgKNIpRrdA528KnQqUKB3B0WDdi+fbIDuBjIQ68P7z1yxSKZR 51nUQpL0KwnZALAi3NStibBptq3T6L8jGXhN0cye6UIxDUq8T+KgjRWSstc7Tp/srljR kb+hr94b4xl4SkjuZtNIjK7VFzYYZXZwD3Y7KLELxnL6d2GU9D+nMhueThiiiIcCqWGH YaPBvSJ2oPYpTCkl3ILjXNPoU1+IOoGErLOupU1brNWw48kpzQ5EJPZbamxEb3CdYUvy 8BBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807038; x=1698411838; 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=qVpVhfYsMArn5+3t2ZWXwVgzj4H5ByX4fZEF0dWkMj4=; b=b6+qXp0l36ceJYXeeEdQPVnWQQXGXt5vgFmgp3xJVU9NFiDv/c+yY3Oem0kvWUqiqb JsLh7xTNz8pMBvaGvdymER4gJsrb/bHgrGK0zhlk1tARuFShgCp5g7mK2VizpJb7hodR lbwUla2MSRPlYcUZropJvVs/sWuhAsNWckZblZL7IoMnilHgsJa7zk1ROnOGKlsJg750 jxc67m60Hd+Dg451iqyDT8WxtyMHZzCbFjBiYbCi9ElozKXHv916gYJRUctETGVAeIP9 6lQte6/pRO3zQHJcZod+9R0KEh9fJKwP3iaSXwByl99t+rJCGiK50iVp5G2/JwkZ8p6y b1iw== X-Gm-Message-State: AOJu0Yx5kw5pNZ0Dc0LtbywCR7v+FK6wKpvqbX7r01oPjmdhzrm11xN8 rAhUzbMLQ9YiOzWaQUDukTJlObg979fzQbkHCSM= X-Google-Smtp-Source: AGHT+IG/0VQrqjViewyBQe2fMBcwXG9J5zJRIE980+gmv/GovkUaWhRDE1Lql2DXSlG89Y8NLNqDgg== X-Received: by 2002:a17:906:d555:b0:9be:fc31:8cd4 with SMTP id cr21-20020a170906d55500b009befc318cd4mr1556257ejc.18.1697807037847; Fri, 20 Oct 2023 06:03:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/9] hw/pcmcia/pxa2xx: Do not open-code sysbus_create_simple() Date: Fri, 20 Oct 2023 15:03:25 +0200 Message-ID: <20231020130331.50048-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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: 1697807175088100003 Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/pcmcia/pxa2xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index e7264feb45..3d512a292c 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -143,9 +143,7 @@ PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sys= mem, { DeviceState *dev; =20 - 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); + dev =3D sysbus_create_simple(TYPE_PXA2XX_PCMCIA, base, NULL); =20 return PXA2XX_PCMCIA(dev); } --=20 2.41.0 From nobody Wed Nov 27 15:31:08 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=1697807177; cv=none; d=zohomail.com; s=zohoarc; b=Of60nngyZlQCXWpQ0srMrXbtwbcJhFQIQ+fACU4xvUnq6TWesl2PqIo4QS09RC6vRm3pjObVh1jHGo/XimKVi9OQOl+tRbyHDKBKQ121cprbKdkJd6oQ8IJ5+oLsIUT9bW9qOTGf83XyVl6l5O2YyzRLAbyudvf8Fe/GFQCgObc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807177; 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=UmDbO/dcRUqE0czIvHJsu49pLqguapp9vtFtJrgXUPM=; b=JNRHNtG4DH8juE2nfoPlt2D6avr3oJ6OANQ9WNsWCJUtxlWGRJhv5PXIlPcIpLgZwDcifxjBhe+HjqIDkKQhUt7mAulEW0O9gKXZy9VIl34fCpuBgMCu4lv9R5udXB3hQgybL3rvbSN7eVlbtOHmw0gaxsWNWz9yHfNl9Pi2cCw= 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 1697807177891508.80889188365893; Fri, 20 Oct 2023 06:06:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAu-0001MA-L9; Fri, 20 Oct 2023 09:04:24 -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 1qtpAh-0000jg-2p for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:12 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAc-0005Kp-FN for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:10 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-53e08b60febso1167223a12.1 for ; Fri, 20 Oct 2023 06:04:05 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id q28-20020a50cc9c000000b0053f84540db8sm1449027edi.17.2023.10.20.06.04.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807044; x=1698411844; 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=UmDbO/dcRUqE0czIvHJsu49pLqguapp9vtFtJrgXUPM=; b=k2lBeoG910M0jYNxBlYsd7Xo0RPA2TJGgHN3ZlfloV6jh/xDTxeMGa2YqPRv/158s/ fkxGTHNDeIPI0wbJ0YL5mCQFLJCMSTo2casywlQ6NMiHylMGG92KmbX9bZwL6BFJJN2j SnvYRe6c4t2kBaRF8lQ33DIXL/mcXGfp20GkrVHhBd1snEMFRk3THD4A35k2zDH/MAXz nLKAYM4zVUr+GfnLo6CvbshYeLlMAG7bz3U4K1U3D+2NzjbweuNM9GbCxVfKMJfE+nTW Q7e9+wRkMh36Ed68T0l9bBhs6uayqyDNJ5q5JBBSBY8WFCQdsOuBMrqwqQFal11BrQXR Pihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807044; x=1698411844; 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=UmDbO/dcRUqE0czIvHJsu49pLqguapp9vtFtJrgXUPM=; b=NVLTqJ4rvv+aFaHEOoHw8PDfx3ZwnAnYqs29gA/xh3GE87mSi5fXaNvbN+Y1a1SkiZ HcuC0JY/z4IlqArHj5elRVUXHVQpDwOOCEHLLufR6ckCTmclGQwrYY8xVcwMOfrPGHKJ ohedRflA+cRN4LK/wZN7pj1qIqit556cYx99ZwjCPIfhLsz8gyp4FnA5hBh+3tQ5FnyI sfeVSou26YqkzQgC1qpIMzubBlQ/kebwCfK7/GHIvBWcVcAKX1fPrS2UeXNVa3RbOLYf MO6vZNLohgxCIV0k++TpZTuwXMKHb/oWNCUSeJGJWE01Ph6D+AVSjextJbzZlLhS/Enl 7j4Q== X-Gm-Message-State: AOJu0YxbGOyxX9qDrEDAPfnlvycydKsy/cEXhK5DvbhNCjsCxzOToTfI uQeBiJJoi2VelLCICX0IAYhn1MkQz+FtO7tOuz8= X-Google-Smtp-Source: AGHT+IFPx5MOeKfd5RN5WsHWGu4StzuG3bkMIGJvgsSaoJdGtx9W8enjTL4bGJN6UyhTL3mnFhsJvQ== X-Received: by 2002:a50:9ecb:0:b0:53e:f9ef:ca6b with SMTP id a69-20020a509ecb000000b0053ef9efca6bmr1462884edf.7.1697807044042; Fri, 20 Oct 2023 06:04:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 5/9] hw/pcmcia/pxa2xx: Inline pxa2xx_pcmcia_init() Date: Fri, 20 Oct 2023 15:03:26 +0200 Message-ID: <20231020130331.50048-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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: 1697807179112100001 Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/arm/pxa.h | 2 -- hw/arm/pxa2xx.c | 12 ++++++++---- hw/pcmcia/pxa2xx.c | 10 ---------- 3 files changed, 8 insertions(+), 16 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 3d512a292c..e3111fdf1a 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -138,16 +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) -{ - DeviceState *dev; - - dev =3D sysbus_create_simple(TYPE_PXA2XX_PCMCIA, base, NULL); - - return PXA2XX_PCMCIA(dev); -} - static void pxa2xx_pcmcia_initfn(Object *obj) { SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); --=20 2.41.0 From nobody Wed Nov 27 15:31:08 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=1697807114; cv=none; d=zohomail.com; s=zohoarc; b=WHeMbxe2xcCk5xCbIXN3u+0BugBlw2END6aWCB7IR9m/gg/hg9fMcViNojWt+FyRXun1ZTY7FoaofIpIvLQn/jOa4nZd0pMEnX9WLd0XfhyMMoAuutbg9SjF3Q2jdywaqorrPSG2OL8UC6MLytUfoDlcD8hkJ95NCFIPG27OfU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807114; 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=IYPqy4u7cfsh5SducsXcSq0VbtOzqG6fjHMi3h5pwmmPzr76xhmq8KCNLKRldjEK+02yIwoBQ9MqhtJ92BT6Ng3WO9gAEXOIIHDInRK6rUG0NJX37xwPheQZzMYY35pMrWopShbIT4wvOgHp9p2NwVoNvKFDVPQ/pBOhrAKqWcM= 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 1697807114440162.24357041737755; Fri, 20 Oct 2023 06:05:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAz-0001rB-5T; Fri, 20 Oct 2023 09:04:29 -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 1qtpAl-0000rk-1i for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:16 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAi-0005Lx-C4 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:14 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9ada2e6e75fso121421866b.2 for ; Fri, 20 Oct 2023 06:04:11 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id y19-20020a170906519300b009adc7733f98sm1484765ejk.97.2023.10.20.06.04.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807050; x=1698411850; 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=ZaOVU1WdVB2Eu95j73/qAX8nJn8MV4rWIVcHDVM2rMhC1sxAp/tokeGQd8GlpdqfKY X2nC+WJp5gZeg2NFCY/FzqwrB2rFWH265bO2IRC+ckfUpLlsb63WiAUk/wwRlS+hBtHD jc8/cO+9PMFrRnz0yoE9Ox+gywvv2n5dmfI4Iutv/TsV7LaB+R025mtm17bdt1gmd4mR TOYeWAAQ6kPnECS/RMAfEYXS80yyBAEd4F2m66nKYWkEcZh3/9TEc3N0ma5AG9InXkIG Nj4+ew/esqESDofflc5jWEPDk3XcpBz4fzrmFgcTVDz00lCq/4UQgsViI3f0aARD+blO 1dxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807050; x=1698411850; 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=snJoinZoCsAJ8jcDBEAroFyOJVSAA09wJiSmC1Vntz3BIjzPCAtlzuo1XD/sd74AG3 JxH2Lz1PG+IGmdOvxVHHN+/FthqTtHI+9nBT4Q571JSfv7FoS8vGS8ulRUnc5ivsej/D OjXXRLR4/b4Tyi+oarv6bMQMIo8GckMX1zwtzGoztFDhUEPaQgS2DXMeUCCm8iEZncuI dpsTbObdBxei5BZZXY+sOAAHzkuXGLULgbvCqEPIlqZpTT1t7s0Lh29MiuRP+n9RHeOU bdzG5nQ5wouBRCk4KmssHE5PkHMgZES1UVpTtudyXy1rcZP2kwuyIyjFGvOMK/5PiLXa Dk1A== X-Gm-Message-State: AOJu0YwiYBBs4ZwuJY8+x7UnWea3FEnm2xw72bolyU1zV0IUoTy1AFXa rOna6nSFN2F8BzDAVWnST3m7BpTMiX57ebRxS5E= X-Google-Smtp-Source: AGHT+IEElSvLZLeja/TwUNbWmCbY4kPpVpZSNtUdaIS6w7rJaZL27Q6qghDZ4MhE91h1W7ww2LX3lA== X-Received: by 2002:a17:907:a03:b0:9be:5ab2:73c2 with SMTP id bb3-20020a1709070a0300b009be5ab273c2mr1295033ejc.58.1697807049770; Fri, 20 Oct 2023 06:04:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 6/9] hw/intc/pxa2xx: Convert to Resettable interface Date: Fri, 20 Oct 2023 15:03:27 +0200 Message-ID: <20231020130331.50048-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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: 1697807114869100014 Factor reset code out of the DeviceRealize() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 15:31:08 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=1697807113; cv=none; d=zohomail.com; s=zohoarc; b=KUe/vXFnr5kqsSoPBKHt+JE+t3djkRaDKXCtQ/cJjNfSPctZzk+QL26dvy2+vJWSchkYPHrOocOzo+a4riDMdHh+mlEisBGMZpReSfTf88eRPmKBm4d0s9q28+B078bUHo8mstqA1owi+Z7kkX9F/VwlHFAzTMN4/XDds7L9pL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807113; 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=FfPyi15W6vQti3rtrlS9fshilU1P5XQ8Yl+CkeB6dbQNXsKYbPPnniyL+E4d62dnWXPquZZTOvucDorc9vKyguo6Ewt+d+Hhak6y3ZFGscJAOPmHBcxF73qwiSeMs9ECszHmxSpfdIe7rtL0xtd0Djy3HEGl7oESruGWzoG9Eo8= 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 1697807113794751.1736682575704; Fri, 20 Oct 2023 06:05:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAy-0001cy-3G; Fri, 20 Oct 2023 09:04: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 1qtpAr-0000xf-4X for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:22 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAn-0005N4-VO for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:20 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9c603e2354fso173640766b.1 for ; Fri, 20 Oct 2023 06:04:17 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id x20-20020a170906149400b0098884f86e41sm1459879ejc.123.2023.10.20.06.04.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807056; x=1698411856; 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=LEz5uXfath7rEbO83c35/Oj3IIKvsGh54n6x23rKD0IQlgkDCWUhS9vFYWejXNP3VX n1japTovWUJOzG6NYZBkiAeZKUbPZfTx2wZRZace+8d1Vd2PdcXYrLzc9eHaDwWtLvCR hNxmM/gTdd7xQmO48Xl7TdXZzieECl4nFZgh8qekpYRY3jBUhbmzkwjm3NeRcxQ4czq+ rbMHqABjjAqkMJOADXfKGxrzjB5gpwAgv+h7Th1LBxogLmDxxqKUd2u6AupRCyNzaL1g l3kaULXyjAT+Vf8EAZoIkLDqYFIDe5Oto42GzjOiByFo1zvEFl8rpvppGA1xQQqZMSlq wF0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807056; x=1698411856; 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=IGlsMtEN7GK+QMqi1qalh6clZtEPH/SfaFET/DHL6MhMU+o/vJ3hS/TC9Bfbyristp qCrhPfo8AzmSXV4Ivg+p3crJ5/m6noE+tf92JNvthvH2hufcZ4E792IAcNy9nTxQkslz 7JOkWYMSddkr9yZXcIUYqNxRdlNiOo7APWWOSL8HujPmelOe1nE12cIFLSAvchezQeEI yDWzUTMxWffW3kCuPg5Pk6VSbz2b4n7D6We8z7wn8zK/8VhhT6X0Z8SoC5zhsgOI0q9M c5y54UVqJhOmG0B1iLEMCag2iBVeU4pzJRg9OnfVQQ5kAfAHhWcL1muRgl8D9stBm075 Lw8A== X-Gm-Message-State: AOJu0YzVRF1CLGdwP41uy0vFaxULFpSfoW+FMLBnwJss/KLaScFtP2A7 /5z6BT4PS6MEQv+yvZ2kFmTKoKfMi8Sp0jQ3ejM= X-Google-Smtp-Source: AGHT+IFSyYr+QXqXHLdL+AzrN4GyBpfjG6T0Vk4sBiz6q53mPfqZZlbwtP1N+QytK2ENt5c73/lvpQ== X-Received: by 2002:a17:907:3daa:b0:9bd:81c3:2a85 with SMTP id he42-20020a1709073daa00b009bd81c32a85mr4700129ejc.32.1697807055916; Fri, 20 Oct 2023 06:04:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 7/9] hw/intc/pxa2xx: Pass CPU reference using QOM link property Date: Fri, 20 Oct 2023 15:03:28 +0200 Message-ID: <20231020130331.50048-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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: 1697807114909100017 QOM objects shouldn't access each other internals fields except using the QOM API. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 15:31:08 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=1697807166; cv=none; d=zohomail.com; s=zohoarc; b=SD7EkRZCj4WpSV7H20YQ2vzV48HnQsLQIsn0tiLEIhI+8u3vChqVgr79+QIjFfYv/ERSO+OSe79DBawLYV22Ut187umzX/QK8epMnhvfQxVtNwdGk1SwMOIKwuB3V0jm+MHR2mGHfGYZcUYEg64fmqwVppDWMF7VU1CkFbnSnNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807166; 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=efgMgWKdaepj01iM/Ft54sIk6S4lIZf3gGodERjX/fYOQ7OT+FoYhGFj2+SxiqrcTtCrSqTZRokc7EV7Nduy0dOz0hKhU3bnbafrxXSBPzBK6r2jzwa982KXW3KTRyMLYR0nsbNmPjlcmU/vI0aZGJZSq9tw3XvQ/I+OkDR02xM= 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 1697807166719415.39781142483923; Fri, 20 Oct 2023 06:06:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpAz-0001td-Cu; Fri, 20 Oct 2023 09:04:29 -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 1qtpAv-0001Tj-87 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:25 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAt-0005O9-B9 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:24 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53e855d7dacso1197152a12.0 for ; Fri, 20 Oct 2023 06:04:22 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id q20-20020aa7da94000000b0053e9352643csm1404589eds.62.2023.10.20.06.04.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807061; x=1698411861; 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=XIs5MwA96Z1GkELKWrGRCGQIwtM5xqQMwBunRMxLHBh2vqPMO8dHjjDM87iGe7ejIe U6o7czKjElGfPjvAWxtXECaRFSu3JqB0bYck0LdQ/xI72WyJCPUKndNfdeDSY/Dqa5lB ZEc9AizjrrGQAG8StbKoLENga7zD7pOgcZ6XEPW0nSkzb8QHGCrKxegdNUD53KUHjjDZ zszwyjcCS35XsyyaebksYOTkn09cidtxEi9YH5XjnU6rYSxcQeGoJ0iglKZ2+WQrd2mU ycnqnhlQTsad0/AvA8P+nThOcweYrF78V6WrW+rZxMEvRUQZ52c0dvsTF5BvznyQHnLW pKww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807061; x=1698411861; 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=TyginWVURyyAhmyGII5QwuSaVVxa1xWflt492S1lQgT6hE1YFcIMcHHbS0svPWtVOU RKnLeyFqgIR1/tKgm5GjuE15QbK1gaddm26KgoLxy3KTlB05YbBKZR9voxstRtQDHAOC EZBVSuLWbx8yOQTfTfSSYciHbz+0poGerA/ITfWPayO6fKN6OufUEUjfqrQiKGYOpvBb 3ZEU4apzRo41fnWYiCrH5i58ZP3kk32+3+II5hxGRduySf9oZ44JuLkGkS2pB6CVt1OF tXCKAnZHdCiFsY9sWPMvwe9xLC2mVFoG6th7ZlljKH0YdYJxx9kiEPvuYpu5ZDIcVhd9 XiQg== X-Gm-Message-State: AOJu0YxBTg64sMFwZcPRNnZpSd44Gxt+gS1CjhUjDqsF5GWp0srpVJk7 uy1h+TdPaWUHV8k0DbyZXmIqYuibZlrjJAgbV08= X-Google-Smtp-Source: AGHT+IEHhXZ9JXIf20xmHmtBllQggfIQbznjJVlAf0EeoL03otCuzAqz00dhwWL2IR6mXUhG8b8MlQ== X-Received: by 2002:a50:9519:0:b0:53e:2409:d6f3 with SMTP id u25-20020a509519000000b0053e2409d6f3mr1309839eda.6.1697807061542; Fri, 20 Oct 2023 06:04:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 8/9] hw/intc/pxa2xx: Factor pxa2xx_pic_realize() out of pxa2xx_pic_init() Date: Fri, 20 Oct 2023 15:03:29 +0200 Message-ID: <20231020130331.50048-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.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: 1697807167071100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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 15:31:08 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=1697807137; cv=none; d=zohomail.com; s=zohoarc; b=TFBGb1HD4IfbbajeQulRFlpHBXpbb8DAb1BvlV8vHIWB4vPVTMpBiJiRHUbyLIKzwRqKF3h4PJPV3RnBkYNNSoYwYvDFqBMfmrpqKIHyxIYDvJz0ZpyKdBOvE9Lp7HD+JH3V/4cN4YmA2nPFnufL+lKwXeaMN6m1k01BRQjaGwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697807137; 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=MdVYlsPar1s1/H0KXsirOyt5Xzf2SObBniAqSQD0H3s1YwO2I5rQmMQfp0epUmBJWrz9eNi/WDUi/nFx1wFxXrpa7PwWcG5fHJglIcxfscv1zoc2Jwip2ZBnmmcuhBjjCHM1ig24wml5VyZGN42pOYjlboiorooSKt60doh/rCY= 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 1697807137454943.7836154755157; Fri, 20 Oct 2023 06:05:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtpBc-00039j-Nw; Fri, 20 Oct 2023 09:05:08 -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 1qtpB3-0002Ag-PE for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:38 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAz-0005PI-EE for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:32 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53d8320f0easo1154518a12.3 for ; Fri, 20 Oct 2023 06:04:28 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id h13-20020a1709062dcd00b009ae54585aebsm1473536eji.89.2023.10.20.06.04.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807067; x=1698411867; 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=ZgqvH+q5IhCm/GI/MllifkiAU9j58GC1letSB0bXZ6+Y7QUCEmzNL18JxmnqmpTZWJ L9mYVh3ddM7g42KieZDQ/lxIfLV0klP1L9XoXCL1SwsrIQM/ZI9X+/P61nSqZSBer/Lw ++wvCqq2Tl0/mBPdD2qBlVWQOim8IKy4mEyJEE3jVvy9x7FozDugYUTA/kOMx0HF27NN 0w8D28MrEusbZRxYss0FRw+c39vcd/8OFpMc8nhIaUv8P8L64jV4kcGjdMcNhJGxpCOE Yj9Eh0OgK8WwW/GNqWZnZOTJqCau4+ffGLJEgZ4bQ7lkHs1eTS/C6jwRQo1EH+LV+nE+ p8AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807067; x=1698411867; 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=ZjPV/olK+bJf9YcwzevKYaXiMMsLKkYtftpCkVqV08LFn7Hj0/H6AyCq6NwJvcwfL9 3I6DPcG4EMq/AyrtB4m0sLq0yLGUfgxNL8JsvPc2QdPyP3qTf05jW7mQEXphbV4DpO5z V6RHmBT/1gi0H2KU5v1AP1hH2ERv3tbn7Rkb5Hq4jsjIWEFSoI5D1mgu3ZfdTcHV65d5 TRiizGlFuZDmmdzbdLHHSyTk/oYXYZJWrufWbcntP26DR+H+xBKVMQiTKcnt071Sawar giO/xI7V537fxeSp1c9pXzue3nx7OPXsfnVCEVgxDDhrLwn423+KwPXd7WLDZVnTNvb4 r2rg== X-Gm-Message-State: AOJu0Yxy4YKSwOz8h2dzOhKl4LAgGxVYzErbz8/dCEciN21NaeaghtW4 0vmzT5fMa7ZyluBUBQqFFcf+qLW+Ql42/Z19WZc= X-Google-Smtp-Source: AGHT+IGV0EkEyJYfkJeZEEuq2RD7cnvdFDeeIT0lvOxeO6aD8rdwH0tbZyoJGGw/XKcA/Fi7mc3UsA== X-Received: by 2002:a17:907:36cc:b0:9ae:5523:3f84 with SMTP id bj12-20020a17090736cc00b009ae55233f84mr1194335ejc.72.1697807067597; Fri, 20 Oct 2023 06:04:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 9/9] hw/arm/pxa2xx: Realize PXA2XX_I2C device before accessing it Date: Fri, 20 Oct 2023 15:03:30 +0200 Message-ID: <20231020130331.50048-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-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::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.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: 1697807138962100001 qbus_new(), called in i2c_init_bus(), should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- 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