From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5FF7606A31A for ; Sat, 31 Oct 2026 07:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IbZdXumZ Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xN35H-0005Ab-Ko; Sat, 31 Oct 2026 03:00:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xN341-0003Eq-Aa for qemu-devel@nongnu.org; Sat, 31 Oct 2026 02:59:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xN33w-0002vh-Vi for qemu-devel@nongnu.org; Sat, 31 Oct 2026 02:59:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793429976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gm0mk84sUDNkPl+4NjYIALTqw7KcUcNnDVDpuhGxYEQ=; b=IbZdXumZOxYzIkTwCFaEYAHX4anR91KiKSqdsS9Xt4GtrvJ8cX9vA4jiVdK26F3RaiRHXL +GHU3S4foIUb/xkCTZgTRWuoV2C2wrM85pKtDk4caTntOnnz3C+eqD8ydkOG2MaRZStBQM OlYJHO3bJ7ShC2sV+O8o5mukbi4oaw0= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-1PKpcArANYuFi-HgnjTtXw-1; Sat, 31 Oct 2026 02:59:32 -0400 X-MC-Unique: 1PKpcArANYuFi-HgnjTtXw-1 X-Mimecast-MFC-AGG-ID: 1PKpcArANYuFi-HgnjTtXw_1793429971 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8139C19560BA; Sat, 31 Oct 2026 06:59:31 +0000 (UTC) Received: from circe.redhat.com (unknown [10.44.32.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1BA2D1803A40; Sat, 31 Oct 2026 06:59:29 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Emmanuel Blot , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 28/34] hw/i2c: pca954x: migrate mux state Date: Sat, 31 Oct 2026 07:58:17 +0100 Message-ID: <20261031065823.191966-29-clg@redhat.com> In-Reply-To: <20261031065823.191966-1-clg@redhat.com> References: <20261031065823.191966-1-clg@redhat.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Emmanuel Blot The pca954x model had no VMStateDescription, so neither the channel selection nor the PCA9545 interrupt status survived a migration. This changes the migration stream of the pre-existing PCA9546 and PCA9548, which an older QEMU rejects. Reviewed-by: Cédric Le Goater Signed-off-by: Emmanuel Blot Link: https://lore.kernel.org/qemu-devel/20261015-bmc-minerva-v3-6-7d50c8a108e5@free.fr Signed-off-by: Cédric Le Goater --- hw/i2c/i2c_mux_pca954x.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/i2c/i2c_mux_pca954x.c b/hw/i2c/i2c_mux_pca954x.c index 4bb078a03c4c..597e57d99a40 100644 --- a/hw/i2c/i2c_mux_pca954x.c +++ b/hw/i2c/i2c_mux_pca954x.c @@ -28,6 +28,7 @@ #include "hw/core/irq.h" #include "hw/core/qdev.h" #include "hw/core/qdev-properties.h" +#include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/queue.h" #include "qom/object.h" @@ -270,6 +271,28 @@ static void pca954x_init(Object *obj) } } +static int pca954x_post_load(void *opaque, int version_id) +{ + Pca954xState *s = PCA954X(opaque); + + pca954x_enable_channel(s, s->control); + qemu_set_irq(s->int_out, s->int_status == 0); + return 0; +} + +static const VMStateDescription vmstate_pca954x = { + .name = "pca954x", + .version_id = 1, + .minimum_version_id = 1, + .post_load = pca954x_post_load, + .fields = (const VMStateField[]) { + VMSTATE_SMBUS_DEVICE(parent, Pca954xState), + VMSTATE_UINT8(control, Pca954xState), + VMSTATE_UINT8(int_status, Pca954xState), + VMSTATE_END_OF_LIST() + }, +}; + static const Property pca954x_props[] = { DEFINE_PROP_STRING("name", Pca954xState, name), }; @@ -287,6 +310,7 @@ static void pca954x_class_init(ObjectClass *klass, const void *data) dc->desc = "Pca954x i2c-mux"; dc->realize = pca954x_realize; + dc->vmsd = &vmstate_pca954x; k->write_data = pca954x_write_data; k->receive_byte = pca954x_read_byte; -- 2.56.0