From nobody Mon Feb 9 09:22:21 2026 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=1665757972; cv=none; d=zohomail.com; s=zohoarc; b=kGppPASUWYgYV052Voo0u3qFDPoYqCNzdKtkMMPwMbNlk7m/jx+ZYXAJyubolz0xTKqTERH0M1zSSdt16P/oSQgv33yhciaVPAVeuc7QEmgiMsovE4EUo79fHHNk8yrC38dwo28qIue/qGzV/X1OT+CaweF0QHj8FycF6uohkA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665757972; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aWAOf4PPjM+pqgttvuA5UCkcEntXj8pU+rzFsl+xr7o=; b=h1Bn/4ydpIh1cnmdsY5KoJS/2u3AKqNMm37EHyPMH+H+vRj1Fm49rpS7968dgrwXyJzWL0AJf8z/gh5U8DKjzYLWo5LFDgUsVi5+c27BtJo3dBLl1cT49QH+OC5bfiO0Y95t5yLJfPd9zIsaTw8aCAYwBRY7s8BQXIxDYf8gRng= 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 1665757972267651.3588302983228; Fri, 14 Oct 2022 07:32:52 -0700 (PDT) Received: from localhost ([::1]:59402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojLk3-0003Yd-7W for importer@patchew.org; Fri, 14 Oct 2022 10:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojLe3-0005oX-JY for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:26:42 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:43861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojLe2-0008TP-0L for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:26:39 -0400 Received: by mail-wr1-x42d.google.com with SMTP id n12so7806719wrp.10 for ; Fri, 14 Oct 2022 07:26:37 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id i3-20020adfaac3000000b0022e62529888sm2183530wrc.67.2022.10.14.07.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 07:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=aWAOf4PPjM+pqgttvuA5UCkcEntXj8pU+rzFsl+xr7o=; b=plD8mmNxfXCfBPuTs6Q91D0Aj8e70r6+mwojjDgDyE0WvqdQ5W4djNvoxPSjKK5o0B u765O67rgIim1r93Qcg97Qt4FZw8koceH3ZDqKYW5Mzr+bBBm6T4qdTFH2ZRkUiqZzUZ 967xnf3B2pxDc9qGWhI/3OQZGhFlXeKFOLztotfAYOhrl4TdtFCbssOBTsCkVRlUYxg0 9+biGxhTlCzV7PZD4Rj/QcSDvptTIDHVdopKPgDrE7FXRUez79S0sUS6255G7h3/nLO0 1PgY+iO5+U81Se3JNekCk06fvDYlIScwcaqpPOMUj/kQ2mbLnIduUlBt2xActbDQIa8f /THA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=aWAOf4PPjM+pqgttvuA5UCkcEntXj8pU+rzFsl+xr7o=; b=ANohpy9Kz5wguX5t8L481SdF8wKCipgg9sYHrU5mT+l9+7feoPUf2OomiBCtK0KJOt OTDp4zFWPP4W5TlzF1r6dUCjucdc4znj/NtY/wO92jqi/zwyPpMAHZl91v4HhGrK/cox UE6DolEs0m4CKVmGJEXtb+jX7IZc47K+AHqJ8u1LKR+zeXb2wjb7zOwD3XaSd8ISIbjh dz6tuqaejThPSE2S4t83fPVYWZpCVRCs6+cpWBE/DaY0OS0krpNZn+49JiW/sh6seJho 6VahO972MXzu3HCKwSoOKda3hZHPgHFdttW2U7hvKlBz9yLjqeRA0BfsEZAJ/rt0ANBf PhLQ== X-Gm-Message-State: ACrzQf17H3z3kmo4K4PYRJMib5zl74E/A09l/llTr/pxuo9EqT4JefL8 LSuFyvRPJatpQJ/IvkK2rQvOr5DTdQEc3w== X-Google-Smtp-Source: AMsMyM5k8nPGQgjo1NdUvaFFqCLKK+kWjuNT7fuDF7Q3KQuWGk2TJAW9Gj/3H5iv5nimGEgB3sgJcQ== X-Received: by 2002:a05:6000:1f9e:b0:22e:61fa:3f1c with SMTP id bw30-20020a0560001f9e00b0022e61fa3f1cmr3509892wrb.546.1665757596276; Fri, 14 Oct 2022 07:26:36 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Subject: [PATCH 1/2] hw/audio/intel-hda: don't reset codecs twice Date: Fri, 14 Oct 2022 15:26:31 +0100 Message-Id: <20221014142632.2092404-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221014142632.2092404-1-peter.maydell@linaro.org> References: <20221014142632.2092404-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1665757974127100001 Content-Type: text/plain; charset="utf-8" Currently the intel-hda device has a reset method which manually resets all the codecs by calling device_legacy_reset() on them. This means they get reset twice, once because child devices on a qbus get reset before the parent device's reset method is called, and then again because we're manually resetting them. Drop the manual reset call, and ensure that codecs are still reset when the guest does a reset via ICH6_GCTL_RESET by using device_cold_reset() (which resets all the devices on the qbus as well as the device itself) instead of a direct call to the reset function. This is a slight ordering change because the (only) codec reset now happens before the controller registers etc are reset, rather than once before and then once after, but the codec reset function hda_audio_reset() doesn't care. This lets us drop a use of device_legacy_reset(), which is deprecated. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/intel-hda.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index f38117057b9..38cfa20262e 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -516,7 +516,7 @@ static void intel_hda_notify_codecs(IntelHDAState *d, u= int32_t stream, bool runn static void intel_hda_set_g_ctl(IntelHDAState *d, const IntelHDAReg *reg, = uint32_t old) { if ((d->g_ctl & ICH6_GCTL_RESET) =3D=3D 0) { - intel_hda_reset(DEVICE(d)); + device_cold_reset(DEVICE(d)); } } =20 @@ -1083,11 +1083,9 @@ static void intel_hda_reset(DeviceState *dev) intel_hda_regs_reset(d); d->wall_base_ns =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); =20 - /* reset codecs */ QTAILQ_FOREACH(kid, &d->codecs.qbus.children, sibling) { DeviceState *qdev =3D kid->child; cdev =3D HDA_CODEC_DEVICE(qdev); - device_legacy_reset(DEVICE(cdev)); d->state_sts |=3D (1 << cdev->cad); } intel_hda_update_irq(d); --=20 2.25.1 From nobody Mon Feb 9 09:22:21 2026 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=1665757934; cv=none; d=zohomail.com; s=zohoarc; b=iIPkct60T7/+fbsMdlDaqHudrpeOXXE4M/4riXSZioBRl8s7I2ZMqvpe7g6bOVNPPsgGiQr5+dHVHnVsLX4ULzC1UW6ze+uDXVSiixWWXgC3hCKkyIEUPIKOISVGY1NqpdbI0hCQ3BynMynFX0agAgIscoV0FHoaP0asHzzp7Rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665757934; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Flm8+S+i6iH5FMi/IsYCFIcRXsXEtN9MK+hXjFDVzjc=; b=YcE46+N7TFR4naIbw6AK25aE9f76tt5urdJcM7/UnnOH9AQdAdekqvHO8LwPFHmMy/JsNSMlF5Bvr1MCUheCpgtxn5zaZ95FaGQ6m8vNYcEvYxhnyeLwUYzJwxsOBtRtHzrEeWhvbZqlB3uwnRCZsEKab91EqC08PUe6cfDfm1s= 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 1665757934256125.69433668920772; Fri, 14 Oct 2022 07:32:14 -0700 (PDT) Received: from localhost ([::1]:51096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojLjR-0002R3-8X for importer@patchew.org; Fri, 14 Oct 2022 10:32:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojLe4-0005oa-QJ for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:26:42 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojLe2-0008TV-Of for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:26:40 -0400 Received: by mail-wr1-x436.google.com with SMTP id a10so7784649wrm.12 for ; Fri, 14 Oct 2022 07:26:38 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id i3-20020adfaac3000000b0022e62529888sm2183530wrc.67.2022.10.14.07.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 07:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=Flm8+S+i6iH5FMi/IsYCFIcRXsXEtN9MK+hXjFDVzjc=; b=a3z825ZscBkyUPs3juGztKd2x1iDqztR3FGi01CpjZeg/SnQsNIt5dBB8NnhoYJKgY GlrDqyGcuD2usvvt9q0RgY2iCip++oMG15TYJjDRzk+Q4blsDuXxhZqSlLbyIjA2mFHx ff9JjcTkSUDihOZef8AygfWqWShVRG04644RIlJaSdtHvRlInNcMFAquOVyX58aYaugo TACGmjMJHpggnCd48cXJGLrsujD4Bw3vUPjcaR9LE+OAzUa0bcyNs2+2g8MawsYow97m klfF30RuyDLGeVu/mN0MuizB5Bo96yp3MhOYFd28R407V/vWl7YPkpHZ35X8hTgcIINa 8+KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Flm8+S+i6iH5FMi/IsYCFIcRXsXEtN9MK+hXjFDVzjc=; b=OtAaD/I1+7CIbrZ3YhUxPfclCSPZUPlEr1NqnSOkSzHpfk5hDKd/5UfdvLwkAdHI8N 6KpvjXQ3Gf0tlvVSavzCHtyaxaQBthTECSLfh45Z2rrzeaWXIAvIfCuFCypXQH+wVviK Jzp6iRHfpQAdrojEcOFI4UA0dQJ+h75HKigr+QgNtrCpVr9JAT2U0F3EtE7CIHo1RlVf yAiD8AMDoQVIMaAy/hW1UIx1lw2RZZQDwcrYHiECP51u3J3uGcxQuX6X9kGAhTvjBx71 QIpTTiNGDjGW0d0uRK4HnONV2ADdy0tWfpVpX6Fpzpc5qPSqJE2/M3cgSC/xhZX58jla SS5g== X-Gm-Message-State: ACrzQf1htGtd8gwXXidnoU1A5EcGbZctg+vulGDubdP9K1IeCfJYn5kJ 4hIznKmwraro4vh6VLT9BrKtzNzCDwp2TA== X-Google-Smtp-Source: AMsMyM7eWl3nPmKvs+CNea23kFaENf933ldlutMIdo/tKGdlE2knY8KDvhtqwqPXG5ErvH7DqHP/Og== X-Received: by 2002:a5d:452b:0:b0:22e:3d4a:2ea3 with SMTP id j11-20020a5d452b000000b0022e3d4a2ea3mr3506626wra.309.1665757597249; Fri, 14 Oct 2022 07:26:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Subject: [PATCH 2/2] hw/audio/intel-hda: Drop unnecessary prototype Date: Fri, 14 Oct 2022 15:26:32 +0100 Message-Id: <20221014142632.2092404-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221014142632.2092404-1-peter.maydell@linaro.org> References: <20221014142632.2092404-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1665757935849100001 Content-Type: text/plain; charset="utf-8" The only use of intel_hda_reset() is after its definition, so we don't need to separately declare its prototype at the top of the file; drop the unnecessary line. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/intel-hda.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 38cfa20262e..b9ed231fe84 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -220,8 +220,6 @@ struct IntelHDAReg { void (*rhandler)(IntelHDAState *d, const IntelHDAReg *reg); }; =20 -static void intel_hda_reset(DeviceState *dev); - /* --------------------------------------------------------------------- */ =20 static hwaddr intel_hda_addr(uint32_t lbase, uint32_t ubase) --=20 2.25.1