Message ID | 20240209123226.32576-6-philmd@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp824108wre; Fri, 9 Feb 2024 04:34:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU/7qpfmOmbhW5oxzbsa4ApjSqe87Z1aanOkYJMH4F8/BqDEcSFotXiA2vTk0+roanPLLD8P/WM0hqZdu/W9cBt X-Google-Smtp-Source: AGHT+IFAGy5RAmJJyJAJx+6NHN4z6Vwr6BkEw89bm5cYWf993LaOq7/bAu7YpIOWGavhbLQDaqK1 X-Received: by 2002:ac8:110c:0:b0:42c:5c0d:5f79 with SMTP id c12-20020ac8110c000000b0042c5c0d5f79mr851641qtj.36.1707482049673; Fri, 09 Feb 2024 04:34:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707482049; cv=none; d=google.com; s=arc-20160816; b=bYzJ15j8ouJW4N93I62BYqndPlWP79FtLIxIsdaQazco56S2vA1cIe8hmi26+5ndhy tW6eHqVWmWOkAzXfb3gMQdpPOeDByGEUwpisCx709RrlswbA+ncf3k+LDZ8U9IcOlFW+ Ru+lsiIaC8FHdWyF9lZPC2ysh5msYnBlwce53JNcR6O6wBw0jdm5MgE33bvjaGJpSkE+ JZhMaiCf8IIIOKq89iEAHusSB+fhd30VAHjXOZquVbwEKrIGfGNndwPPtDeq621E6q2u XOO6RUgZrAU+6ZWK2l+C+to3S7Q5Q/yT+7vtncm1O56/65odb/xfNpYlv3WAu9azOJZT CKZQ== 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=663egtvXUtLR9ZdYJglQVLyO0fSnzktyc0JFemad5jI=; fh=kws2JOXARFZGR8d8ikPt3y/UbLEcWKfJpsfEE+D5zaQ=; b=cKFr1loodKLzEA+/x1BNsibCIUAVrqYky8gZeBBbSS8dpg5KnNc0Y+YJourCL1DaAN Vnty2lqLvlmTkDwHCmE452knpMp7t+2QXZrTiyMmfks1ATQkyGNOn0YKrdAlG2ck3/Bx YgSvcrwQM4PD5LngzoX1ZWj+JaKvtWXaoBWLzqq6vdK+LHc5B5I0zsPR+5nzXIzmi0UV NAS93Oc1qju/MqK/9Fd9YqxuxWCQQHkzXyYkUY3v7lOs7gmara5re0TScEnpgRMOFyAv AzYotB+hpY4IXq9ftz7loJLQWjQEr0OvdOedeX9s/x/hRA1HVx2Fk6fnWZpgkMlY1xG1 9pDA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VkZgDstH; 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; AJvYcCUdqEn5crJGyB9UJP8wVtx7hW7kYDgpvnk/zMf1N/0y8i/DV/sZFZaDE1lKZzBtrKAkQppcdHhz/bOfap3wJeEP Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j13-20020ac85c4d000000b0042c39fbe77esi1798733qtj.53.2024.02.09.04.34.09 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Feb 2024 04:34:09 -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=VkZgDstH; 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 <qemu-devel-bounces@nongnu.org>) id 1rYQ43-000826-12; Fri, 09 Feb 2024 07:33:07 -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 <philmd@linaro.org>) id 1rYQ3z-000814-LF for qemu-devel@nongnu.org; Fri, 09 Feb 2024 07:33:03 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1rYQ3w-0001vb-Be for qemu-devel@nongnu.org; Fri, 09 Feb 2024 07:33:01 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4102f273c46so8076925e9.2 for <qemu-devel@nongnu.org>; Fri, 09 Feb 2024 04:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707481978; x=1708086778; 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=663egtvXUtLR9ZdYJglQVLyO0fSnzktyc0JFemad5jI=; b=VkZgDstHkxnn2B8fKe0kSgjsWIpARPYbWkRqnwtBnTW2OvQ6jOkp87I8tY9HDRzzOG mlSrr5ENvYdjWZRY1YBN5HFhEyxtjc3sLLSYJZOAVvNKZampmi5tkPN8TficGfQj6J9b kvoJCqHukPN4Z2BphXB3t0hfhjljopKDKY6XZSYuPZWRhn696AtLrsPTUi3rGPOOPZEG CYoSwXA9953ZPm2AhN+XLw2AeSV9ci08nXqC+POTHk++zh1SbM3O9MQo9E8Q/fD68nAL dSdtS0Ea3qZlvGHhW+UnsMux2hBRpPeNk7HksoV93wq/kKf4N838SKxhQw3SCYErGrOu vE8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707481978; x=1708086778; 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=663egtvXUtLR9ZdYJglQVLyO0fSnzktyc0JFemad5jI=; b=LVxTY1opMbh/N+ZUhSZJWaVqpVMIIUcpesqe+Vz27krqylK4A9aWPPwXZ9PcpAbUyA YksvCcXlZekQIUGxYWKSow2QnzE5J2Ue1HvKjd7yjWQn3r3jkDs3QIAgP50inIdIm4eV 8AADtzc8ERDBt2BFPKHxELtI9DwtoXS31Wo9cAqZuox4nosj7pkQ7YbVtZ5mbqyhwSiT 6IQXbFE/9novL++FEuz1aO4RUZ5UhFUJ5AHoeMOdA4sevCdkeodVwwkbe8adLqjJVxOy fyf9ph2i1tauh3LbLU9UzhbUCR6t+Yg5u+JMy2CiI5+v+onkoCfeW7F0mJ04m4njws1o UWGg== X-Gm-Message-State: AOJu0YwJzmPlnyP2qcbWW9WyaFD5NZsbR+NGFMPwZH16kIAvQ13/ozqU wVHLYrI9ccUiXoaaR/8Am68PrZuz1i0JIPBY1GkdwQgb8LHgT6sKEHEosssxy9alh4Nc123Ej/m x X-Received: by 2002:a05:600c:5490:b0:40e:f9f4:eeb3 with SMTP id iv16-20020a05600c549000b0040ef9f4eeb3mr1183393wmb.39.1707481978515; Fri, 09 Feb 2024 04:32:58 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWLFp56gSVTcUfodr1Rna4sVxwxJhyecQssHGjTR7aBYKt+0e/yCFmFwPuM26IDC7BcQRETgc63keWsPYTk88MiGyK1fJK0FzqyxsItQdgx3710dmTLiGkhWgjNo7zZqqDXp4iSLR9uf7CKQWqdBIUgBqqiYoa1je5VtPHBzhCC4xUvriq8lbswPuzTOiBrOh7WeLlR1eUrtf8x0xPtmUjyyltScyNs186w7avU8M4ZlRmopOkY6b86CM4brYlCAuPl6NimMbB1dqMIKjVFuJAqSBECDJprDgQvAj5PAQy+tSlm34l/Cdc8V0c8cH/jpQMe3MKApeMR0PE= Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c294200b0040e3635ca65sm509303wmd.2.2024.02.09.04.32.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 09 Feb 2024 04:32:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, BALATON Zoltan <balaton@eik.bme.hu>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, Laurent Vivier <laurent@vivier.eu>, Jiaxun Yang <jiaxun.yang@flygoat.com>, qemu-block@nongnu.org, John Snow <jsnow@redhat.com>, qemu-ppc@nongnu.org, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com> Subject: [RFC PATCH 5/7] hw/ide/via: Configure IDE bus IRQs after realization Date: Fri, 9 Feb 2024 13:32:23 +0100 Message-ID: <20240209123226.32576-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240209123226.32576-1-philmd@linaro.org> References: <20240209123226.32576-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
hw/qdev: Split 'wiring' phase from 'realize'
|
expand
|
diff --git a/hw/ide/via.c b/hw/ide/via.c index 3f3c484253..caf1b69bd4 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -226,6 +226,15 @@ static void via_ide_realize(PCIDevice *dev, Error **errp) qdev_init_gpio_in(ds, via_ide_set_irq, ARRAY_SIZE(d->bus)); for (i = 0; i < ARRAY_SIZE(d->bus); i++) { ide_bus_init(&d->bus[i], sizeof(d->bus[i]), ds, i, MAX_IDE_DEVS); + } +} + +static void via_ide_wire(DeviceState *dev) +{ + PCIIDEState *d = PCI_IDE(dev); + DeviceState *ds = DEVICE(dev); + + for (unsigned i = 0; i < ARRAY_SIZE(d->bus); i++) { ide_bus_init_output_irq(&d->bus[i], qdev_get_gpio_in(ds, i)); bmdma_init(&d->bus[i], &d->bmdma[i], d); @@ -249,6 +258,7 @@ static void via_ide_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + dc->wire = via_ide_wire; dc->reset = via_ide_reset; dc->vmsd = &vmstate_ide_pci; /* Reason: only works as function of VIA southbridge */
We shouldn't call qdev_get_gpio_in() on unrealized devices. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- Ideally we should rework the current IDE bus model to really use QOM and not globals. Left for later. --- hw/ide/via.c | 10 ++++++++++ 1 file changed, 10 insertions(+)