From patchwork Tue Feb 13 13:03:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772306 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp241969wre; Tue, 13 Feb 2024 05:05:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzKehcgndG58ilDmj8LOKiCOHbvjKg8ol79V7+hD/gMdJ4PV4UMu2cELMNDFIXsooj1l43 X-Received: by 2002:a05:6358:921a:b0:178:f497:ab3f with SMTP id d26-20020a056358921a00b00178f497ab3fmr8162097rwb.14.1707829556487; Tue, 13 Feb 2024 05:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829556; cv=none; d=google.com; s=arc-20160816; b=T4b5urztSy3GOfC4/0h6byIW5YeroHGApyXJOXt1P4qh9VYg8NJCEewClG47WKGg7i KmfRfgVpUU66PeIkQXDLwcN2+j/54Qu+IpwDeMjsg9JsyayNscmx83VS8W87V+FW4DZe RjqU4sMMfQ8d7w7VQw1pE6EQyTuKg38bpaEFPxw7NyqzaU4C4PSND0lSZLveoX6wfEuc 76pza0AGbE/HNN8yT+q4YEJIqH6/Gfto/pFU3EUTz4q+BS21XMFpV5cW74Kuz8o+AMb8 8Lm+l3rt0ADFGuVp7Gup41gybX6g2d+j1ihpdE8dpnsx8FTN6zHg/vJpiZDJOUR4CoBG JgoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KjkB+UnEukm/G3HfYj7xftramerJL8Ci1VN86IlC3EQ=; fh=HsMxguKqC9L2sTUyTHdJ37HBU1V1ryMBLydgQCYEN4o=; b=g+Fh/m1ccF4vxdLNcPMVm3HXfpmqqbj3kTjviMw6mvNgvLjqtVUzkBrkIfaM5mZT9P 3iOvZTNTbA0OTKhaT6smmwpWEX+pWfwSBU+lYOyyetF7xVE78kEki5H81xwpTIpjvBrT B++6RFQ+Ya9kRUcjUvskEBcGmqUNIOSRMlzecIaIX4sfS0q0380+bUJh4z4PA7oX/8BX hgUKPmdBsShM9Npoy8kef2zDoRMABj3la/jgNyKPT9a4/l8rWQLC8qj8ev/FsIDw+yIj S0euw3i7hhnYh4zlptPpH4QjEQu36sOWl2qD/wwu70BmGjwgwsetRoi9bv49aJWZyBtR 4CAg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zLix+y+h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCWwx/p5Vk7XXno6rzfn2jkbnzYGEc9FutK0ZD5f9qmyt9x3klPjqK7tTaE0UTiU4OCALXWGrJKUxplEMsGUGsTA Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l21-20020ac848d5000000b0042c06c5df98si2487299qtr.255.2024.02.13.05.05.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:05:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zLix+y+h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZsTu-00036h-DV; Tue, 13 Feb 2024 08:05:50 -0500 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 1rZsSe-00020Q-PJ for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:37 -0500 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSc-00065V-2X for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:32 -0500 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d0b4ea773eso56678131fa.0 for ; Tue, 13 Feb 2024 05:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829465; x=1708434265; 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=KjkB+UnEukm/G3HfYj7xftramerJL8Ci1VN86IlC3EQ=; b=zLix+y+h6M8Mo5JxlojlTgkM2DJHY2Wp44kxEJBy0913n1yBIHyJBYwC4SAc4f65QV m6LV72+hDbyGXapG4PAzHyV1NA6ifEZEj5NZpvSqEUu/hTXmyvQ1TZpBtoa47M3oSyW1 GVXNR6cNmLmXuxWFvQL8OdVrxAdVGCyhYwb2zaRPyTPRK0kDnQYygjBwq0PcWeZbXdmu HrslsdBx+5svjv10dw8C++H0kgfKlMBR1zHAydOliw7Z7e1A0dP0JS5SEucEsGfwKM94 02WVFYTj7RbgmOpXgNIIJYXsmWnbGl4nURfOz1dmKv23geqyrPB5EiddQmPs3gYFWcI0 lpjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829465; x=1708434265; 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=KjkB+UnEukm/G3HfYj7xftramerJL8Ci1VN86IlC3EQ=; b=MAGHtiiY06O6hdDRaAqLv4dly4TzXq0P523HpCgYCC9+cl3zPLNeR94fWwuvp46Np1 6ZnnS6rfxL/07xb5iJwRjh2xPlay+Mdc80WZTy5uL3Wdd1A0uURZmZkf+SRAqMUTjn0S vUI8qotxmLwJW5hfSa3siqc3Kggb1v6jYmoAdZgaqOg9sECKfe2fQDGKZzUWDuRosLOf cNoDwnjflwXYLrFT1OCnjLPvp5Cm1bNuCUz26rxKo0gGlwRgWvfTrt5rCOQeFqMuI5w3 PIWcaZwFLbYAoELG++aqK9B0eal2nJOrOOE40bBioExswETWUtqWMw8Mo2Rdq1cfldWx gPZQ== X-Gm-Message-State: AOJu0YyLMyX3vOEy9TPAg+EFEdLbTU4xXBsVYPQkMmE7gIU5IYKsw0so WMT67WK5vYKZ0nEfWAVvWN8xtJfp0QX0yMdYfddRTvQW2h2ZfXLV+L/2jniXKa1ScCaCM70JLOd l X-Received: by 2002:a2e:a615:0:b0:2d0:698f:1fb with SMTP id v21-20020a2ea615000000b002d0698f01fbmr5797890ljp.5.1707829465497; Tue, 13 Feb 2024 05:04:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVdOCzsYTBBK7kPOb9KwFlrPl9+/2764GRmGdTqaSSS1tmSSaFRTKYDcQ/TzlyIkOItZgmR6vAVlr/SIAXXUHtK6C+mw/6xAT3jrXMK5xvqwnnA2ngWuaYefelaA6dpX4QTRuvhlxfw2OVlvcwzwBNk4NwKX+qifcCgg5iskJRgbgNn54GZjjPe6P/KiuDjhSPIO1Hg/X5lKyAEM1QdFujDcVmxeMVW/hfN4JJvKWXg7N5B09K5855vCsVCEafvJonZh4TY0C8qa7/UKAY8i0KgReY4UHe15nb6SSr85+Tt8eoeJarNtAeUt7YSKwI/X8b1Z6LGJG4= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id h11-20020a05600c314b00b00411ab6dad65sm2948681wmo.29.2024.02.13.05.04.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v4 06/12] hw/misc/macio: Realize IDE controller before accessing it Date: Tue, 13 Feb 2024 14:03:35 +0100 Message-ID: <20240213130341.1793-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Reviewed-by: BALATON Zoltan --- hw/misc/macio/macio.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index c9f22f8515..3f449f91c0 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -123,14 +123,17 @@ static bool macio_realize_ide(MacIOState *s, MACIOIDEState *ide, { SysBusDevice *sbd = SYS_BUS_DEVICE(ide); - sysbus_connect_irq(sbd, 0, irq0); - sysbus_connect_irq(sbd, 1, irq1); qdev_prop_set_uint32(DEVICE(ide), "channel", dmaid); object_property_set_link(OBJECT(ide), "dbdma", OBJECT(&s->dbdma), &error_abort); macio_ide_register_dma(ide); + if (!qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp)) { + return false; + } + sysbus_connect_irq(sbd, 0, irq0); + sysbus_connect_irq(sbd, 1, irq1); - return qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp); + return true; } static void macio_oldworld_realize(PCIDevice *d, Error **errp)