From patchwork Fri Oct 14 14:26:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 615068 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp333985pvb; Fri, 14 Oct 2022 07:28:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mZVNfUOr5KgSpKStkaKEKVg1pvncFh4t7OC8Quicx8OoNkllN6CLrPZntfKGqbRv4AV5M X-Received: by 2002:ac8:5a90:0:b0:398:dd09:2e41 with SMTP id c16-20020ac85a90000000b00398dd092e41mr4435462qtc.108.1665757685623; Fri, 14 Oct 2022 07:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665757685; cv=none; d=google.com; s=arc-20160816; b=JFtIjrpcuMjaXG1CnvwYcGwLpCsyVvX6vndaRIlWY5a1xFK0elglbrQ5sBfF6oddHQ 7FYxcNqnIDdD4i1hhm0m2kVlZwRzwIrdeeHBNXreXajFubQktjFdgdE06dz63eQ5pV4l NK0tYD00L/10cd3Hlo6qHdvegceTPbD9q6Z3IrbWWFdLI0HearXOx9mO3sp8qWvOVW2W AlslXmHN/MHbTE5UwHYtCK5jsW352SNDy2iHmK110ohCf6ilWQVgtVL0CP9nvikf65OM 411H6jUvqmMGHuyuyGkquiTkcapEYkyTKeXg9yCYw1pvHkV3fxp+/1tNDj4bMW/pYE2b ueOg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=4uD5yivt1pHdZZRlK2EhxLXfCM4gIEIw4oTGPIqGQOY=; b=x+6yfDoqB29lTJLALedxRty33CoPwBL866XASEtAtfYa0asYO/XEyXH2cuFv2uBOpO llvLB0Mmj1SS21QVGkuu9Piz1Qs6WSI6pX/6Nv68oV5wyhzkZpfgQKjM1lo8WoyIhiZY dbMDs8VdSnHXm2wA3h/CIkrex//l9+aC7uUuJrIOmyXz2FCSTYP/dPYO/1pbgK1XvYNL 4cRRORbCcdKAIBvOmfLWDSJpdukT0kMbC1IkYITgtndg1ZcGJc4zB7kw5sZ2Y/8FiYcm IZrYqvjOH51ZtsDbMyBX22WSw8nq/LEd1/eJi9j/CiFiFpj++CcFdyHS+1js52khDRpl Vnkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zj5j4OdQ; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o8-20020a05620a2a0800b006ed4c4d78bfsi1429034qkp.616.2022.10.14.07.28.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Oct 2022 07:28:05 -0700 (PDT) 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=zj5j4OdQ; 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]:44208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojLfR-00060H-3k for patch@linaro.org; Fri, 14 Oct 2022 10:28:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojLeF-0005vp-Vp for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:26:53 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:33337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojLe0-0008T7-Ur for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:26:51 -0400 Received: by mail-wr1-x432.google.com with SMTP id a3so7908027wrt.0 for ; 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:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4uD5yivt1pHdZZRlK2EhxLXfCM4gIEIw4oTGPIqGQOY=; b=zj5j4OdQAgEFxon942S3CsYsO/2PRlmymPX+41dZg3coEuE+vUWIZGv5KDpjE+t8ZK 91LZTvWj+Pf9Z6QJbFqLVmYQf6gH6EQxdgdJ18VvCpPfzW0czv+tJUy3fkXpUe+nawz1 /ww/1o2te0NVVBeGw6UWeyHJ/g+kW/RijfbrkH0UigehbU0/aYbcmRTJ7lNVdm2M2UEM 9p9A81lg11LYJCi82JqAGnRpylkw4L66FHpGT+Tq10eSeFdst/JKs3eJd2qC3QELr2rr TJ01EYmn4XA9n+EXtaArHcPhTWfJfnlIrt/U44ljF5dWo2NdRblRbjiKDHYV7VONBMRo m+Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4uD5yivt1pHdZZRlK2EhxLXfCM4gIEIw4oTGPIqGQOY=; b=fzn5H6WLAPooCZf9kpt5NH5/AOt84cN82oWd2hXj6ywcoRRh46LHNDzHkbPn8eEyy1 9ZEs7Qs7VvEI+vTKlBMr3MwQCqkoMxbGnUtQ88sFHdhvi0HNdHQGQww0jf49bU43Qlh2 Mjjfagt1CJOgtjtClHPqtM7MmbvKKlYOBWl6zwlayLa6s8+An1VjUM92C8LYZIIaPFM+ P9mEH/bj8c+mrVW1vSibu1HRDAHJlbJibPB5H4M6uqlqkqrPIWL2aUXwmzAG6GOSrNAL jtaszYP/wrrUE5IhL1vcbI1/w42adxWN3pHWlUuhwaSmYHFDMQbRKWVY3AqqccSDi7Nv ZcSw== X-Gm-Message-State: ACrzQf33/qBnq/+yg5x87dCtdsiXYiGuf26fv6lEi2RBPpDXwIhABy1u gN7xyPGFxj+cOe5EBGr9E7MTzEJyHabHxg== X-Received: by 2002:a5d:4c8c:0:b0:22e:d81b:67cf with SMTP id z12-20020a5d4c8c000000b0022ed81b67cfmr3512743wrs.69.1665757595228; Fri, 14 Oct 2022 07:26:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 07:26:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Subject: [PATCH 0/2] hw/audio/intel-hda: Don't use device_legacy_reset() Date: Fri, 14 Oct 2022 15:26:30 +0100 Message-Id: <20221014142632.2092404-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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, 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This patchset removes a use of device_legacy_reset() from the intel-hda audio device, and removes a duplicated reset of the codec devices. 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. Patch 1 drops the manual reset call. To ensure that codecs are still reset when the guest does a reset via ICH6_GCTL_RESET we make that codepath call device_cold_reset() on the HDA device (which resets all the devices on the qbus as well as the device itself) instead of making 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. Patch 2 is a trivial cleanup I noticed while I was there. The patchset has been tested with 'make check' and 'make check-avocado' (and a little bit of use of gdb to confirm that the reset functions still get called as expected). thanks -- PMM Peter Maydell (2): hw/audio/intel-hda: don't reset codecs twice hw/audio/intel-hda: Drop unnecessary prototype hw/audio/intel-hda.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)