From nobody Tue Feb 10 05:27:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619907241; cv=none; d=zohomail.com; s=zohoarc; b=kyzOXXpBXCha3Ccoto/dllzf7vBV+Y6407BVbqj+bCu8c7PfBsTo+O63F41CpuITf9vLjeUoHvyIZtGKLyXYihzoWT02S3CqZ8ZzhzoL09Daz5WQNUNtvwEhy50Z5wLYJf0BfTbXYRykOZSfA2Mxb8EAtdXPv5f8YM8qxpjg+68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619907241; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=1UI+NSi3BR5rLg3jDpEAayh2qFI6CVFc0ULRL96rJ38=; b=HOV9QaXNaI6h7uVGoIAV4+AHt4KUujIQPQfis4vCUV/uUAiMj8+cterEUicqHWTXbLOqtpoKvBKChscNXlzZ55XQFDistaPlu0/LekzH4AO09sJQs4hKKCGRfIJn6hr2mHSTmwcR5qj6YzIikc+sWcUnJr+ed8I7JP8S6e2bEBk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1619907241321630.5895061276398; Sat, 1 May 2021 15:14:01 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-462-Tu-uDtudNlOmPRzVkBh9FQ-1; Sat, 01 May 2021 18:13:58 -0400 Received: by mail-wr1-f72.google.com with SMTP id 4-20020adf80040000b029010cab735fdeso1259434wrk.14 for ; Sat, 01 May 2021 15:13:58 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (anancy-651-1-208-144.w109-217.abo.wanadoo.fr. [109.217.237.144]) by smtp.gmail.com with ESMTPSA id r19sm16035420wmq.33.2021.05.01.15.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 15:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619907240; 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=1UI+NSi3BR5rLg3jDpEAayh2qFI6CVFc0ULRL96rJ38=; b=COcUQlTqk4ldWT9gkkgVKbIu9aLK8ImFR1x/z4ElMy9Scg/4OMm03YNNl9JhaLtwv2IOck c0lKrmOD8TFXEmyq06e3ikPbwJOy6MN0ak6ZIFpAka2K00bWJUazmnGB/Lz5OJ8hYuKkP0 4GlARVlrY8HeTJBZjANeH8gLxgoand0= X-MC-Unique: Tu-uDtudNlOmPRzVkBh9FQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1UI+NSi3BR5rLg3jDpEAayh2qFI6CVFc0ULRL96rJ38=; b=GvwjgJG8MKSJuvz1CTvz3yfbNLh2CkxqKdptQQIfutMimIUhRCiOtIhBTnNxjlWZ9q oZeH6zm4uqAA6FLZJx7ZnDMjs7F/kgWW77E0i79/MEci0csXZrGcx0krAdFtHiql59RL KP0IDc/XX85n2ikfDQp3IRC8CSkSx7V5Z2Ry7WOhBD6pPZtrOU7b7pWb3W0ackk4Mo/E KH96MMDMhfTZXqPrBrQXMxIMuZE3C1U4AvrCRoVtuVgB0GRwEXBMw9SG15Jr2ToGWdIr JYhnMXZ41Y2EslLWYXXiQb99K6JwjNJKQWKRbra+Mw5w7w4W+bJ/+qF/5vZJlgrXdKA+ q+tw== X-Gm-Message-State: AOAM530wJiF1Grs+vRtOMr9ICUsf7NcKo7OPWgukL0c9qSt59PMvDYfW qc3voogQGaOpWV71mvq22cHEqBB++PMbc9GKkOBc2yai/0q4T2wGYa4NGXmsp+YsMD2E7K7m1nn DshZh7NUoGWkFRw== X-Received: by 2002:a05:6000:136b:: with SMTP id q11mr15836773wrz.350.1619907237359; Sat, 01 May 2021 15:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4Zyk4lIsnuOT7jJWhaqjoF4E0riBTqVOZSxSn85u2ckhXTuikHhrp2BS7aZrwfP0ZIavNFw== X-Received: by 2002:a05:6000:136b:: with SMTP id q11mr15836764wrz.350.1619907237254; Sat, 01 May 2021 15:13:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Maydell , "Michael S. Tsirkin" , "Edgar E. Iglesias" , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/2] hw/timer/etraxfs_timer: Convert to 3-phase reset (Resettable interface) Date: Sun, 2 May 2021 00:13:49 +0200 Message-Id: <20210501221350.501946-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210501221350.501946-1-philmd@redhat.com> References: <20210501221350.501946-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 TYPE_ETRAX_FS_TIMER is a sysbus device, so its DeviceClass::reset() handler is called automatically when its qbus parent is reset (we don't need to register it manually). Convert the generic reset to a enter/exit resettable ones, and remove the qemu_register_reset() call. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/timer/etraxfs_timer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index 5379006086f..7dd3daf6771 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -309,9 +309,9 @@ static const MemoryRegionOps timer_ops =3D { } }; =20 -static void etraxfs_timer_reset(void *opaque) +static void etraxfs_timer_reset_enter(Object *obj, ResetType type) { - ETRAXTimerState *t =3D opaque; + ETRAXTimerState *t =3D ETRAX_TIMER(obj); =20 ptimer_transaction_begin(t->ptimer_t0); ptimer_stop(t->ptimer_t0); @@ -325,6 +325,12 @@ static void etraxfs_timer_reset(void *opaque) t->rw_wd_ctrl =3D 0; t->r_intr =3D 0; t->rw_intr_mask =3D 0; +} + +static void etraxfs_timer_reset_exit(Object *obj) +{ + ETRAXTimerState *t =3D ETRAX_TIMER(obj); + qemu_irq_lower(t->irq); } =20 @@ -343,14 +349,16 @@ static void etraxfs_timer_realize(DeviceState *dev, E= rror **errp) memory_region_init_io(&t->mmio, OBJECT(t), &timer_ops, t, "etraxfs-timer", 0x5c); sysbus_init_mmio(sbd, &t->mmio); - qemu_register_reset(etraxfs_timer_reset, t); } =20 static void etraxfs_timer_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->realize =3D etraxfs_timer_realize; + rc->phases.enter =3D etraxfs_timer_reset_enter; + rc->phases.exit =3D etraxfs_timer_reset_exit; } =20 static const TypeInfo etraxfs_timer_info =3D { --=20 2.26.3