From patchwork Fri Nov 4 16:15:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621377 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp360196pvb; Fri, 4 Nov 2022 09:18:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4z3JexkZg4huaRaUew+ngSDjC4xc57oqxiO6sFqmEzRAdGDe9tqOxBoPChT8GPDrLcjKq0 X-Received: by 2002:a0c:9c8b:0:b0:4b1:ac82:5c50 with SMTP id i11-20020a0c9c8b000000b004b1ac825c50mr33479604qvf.15.1667578694596; Fri, 04 Nov 2022 09:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578694; cv=none; d=google.com; s=arc-20160816; b=j4q182Cb7YcbQfAUHao/Dpspa+Iab1y0OQUaiW7wbzPR4cIdHBiAnzHLzfK7flyl07 /JGJap/bIlVrKQO9RWsADgiW33H3UXhrysFUhR+uvnWoNfmu/ppQeR2e3rqHdFlj4BsU qnLw3PwIAu1sMIomWbjhlz8AzC3PgGQfOHTz0ta8cUQCJMLKWTrZy5wKMMDd9vE8aXNC s/47xH6uOwM6qDe2Xuh67uv1VFMfVebIL8PHZCxNSfSrGAJr0Bt63fOa0JaFKXSZF3qY ZzbpXd5O1+YFHlnUZFc0JOgtrPG3aehXsKKTIDaWOnk/PSPAreQKyrAT2rinrdpiY3iq aOCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=BU6PNz3e99/tD5N663Lv9AewYZquVRh/84XMEC2v1g8=; b=xxr9EISq1cFDnC543/8HhyCW+DfAhWP+NOdaR5NolX3bKjlA0COZeno56Qj7IXEWfU 2zW2+ib/QW4WxM+vk9QuKvEQDAY0ABzlPc5a+JqOa0zUn+ZF+sbFYBYSz/VYl7+V/rFp odg284MRXlLvwAHKHja0i1pO3FPnnORFu5F66el3Fzj+9N+pB/BbJsEf+nDjH1kXzEr7 YoeTskESW5fTf+m/bvcMxrWX3r64bpfERPsCn86gHegesFUNgqS54pbD+T51zP2jNbFw aQHD640GXonq9t/NaST+OLFahmwd6a0glb9K5nFUqmkcWtRxA5DfJx1AAqYghH/1sAnG YHaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U2ljhIqq; 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 fy21-20020a05622a5a1500b0035d420c4ba6si2778485qtb.14.2022.11.04.09.18.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:18:14 -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=U2ljhIqq; 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 ) id 1oqzMg-00089u-JE; Fri, 04 Nov 2022 12:16:18 -0400 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 ) id 1oqzLq-0006Qy-4j for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:32 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqzLj-0000fP-Ph for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:22 -0400 Received: by mail-wr1-x429.google.com with SMTP id z14so7736022wrn.7 for ; Fri, 04 Nov 2022 09:15:19 -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=BU6PNz3e99/tD5N663Lv9AewYZquVRh/84XMEC2v1g8=; b=U2ljhIqqroADthC6bE9W8xn64W4wuRDyi+MmbEFW1diIa4wIJA+rE+W9FX2GLXG+yB xV8lnNova0psX12PLfJgHSlvHGXipwtYsG2X7ve/pvsGb+eHR68RlFthwiQ5x1czwCEz MT+BJIi3dAyyo5zrg7oZIFzCILC+SHZXIe2dKJoM4JGXp8gBV/z8tVP0LplaXU5JcDiM WAl9JxNZPIyEDmVZBqgcITGx6bPasD16rAvrnOMf/FHI2j6GVzTnUs4sakgzNRUJjQ93 XSu7Ovvj+G1qJ6frs3S25YW9IZCLsbKoucmWmrwpwhQKqaNdz0tdUqgvjdXqSw3lKko5 JF+g== 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=BU6PNz3e99/tD5N663Lv9AewYZquVRh/84XMEC2v1g8=; b=qEkkCBuh7oECwZSja4/L2PEvLV2VERc4WLNjaPT2Wg4U2IRWNBzBg3MUQ9u4MdlXfc 6lo2b8ilXJnuQvscCLNUNJPBzhewYcSMMlOLrE8UAYbpMe1lOLfri2QcjIwneT3PCPXH I7zf7CTh8X2s7Y5a/oVBTXWURI5tIPjQEIT/PHe6AAzo0OEbPXnNeGQFOIuZhtWRecAw EP0tZdDjfZZace3WgSicPOOqyu4/GgKruHCj7XwNlS55umVGxG1U8FIscWgLJ80zjvzV Ce4hbgYH+T/I6dtrVR+xtbTZtuVfrLdzQZ26tT6pHkpKRE+5YxfTN106KYUPYrVfbGx9 pFDg== X-Gm-Message-State: ACrzQf1Z1Wk1uUKNpkFqBw7JpyXxkj69jjMDQDwARXhYgkeHB6zjSz0R lzrVmVpD4pXrBpv+XQDmy0zH8M1s0ggZwQ== X-Received: by 2002:a5d:5a97:0:b0:236:9701:97d2 with SMTP id bp23-20020a5d5a97000000b00236970197d2mr249304wrb.185.1667578517534; Fri, 04 Nov 2022 09:15:17 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:17 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 1/9] hw/s390x/s390-pci-inst.c: Use device_cold_reset() to reset PCI devices Date: Fri, 4 Nov 2022 16:15:05 +0000 Message-Id: <20221104161513.2455862-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org The semantic difference between the deprecated device_legacy_reset() function and the newer device_cold_reset() function is that the new function resets both the device itself and any qbuses it owns, whereas the legacy function resets just the device itself and nothing else. In s390-pci-inst.c we use device_legacy_reset() to reset an S390PCIBusDevice. This device doesn't have any child qbuses, so the functions do the same thing and we can stop using the deprecated one. Reviewed-by: Matthew Rosato Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/s390x/s390-pci-inst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 20a9bcc7afb..16f5a3e81b4 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -272,7 +272,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra) stw_p(&ressetpci->hdr.rsp, CLP_RC_SETPCIFN_FHOP); goto out; } - device_legacy_reset(DEVICE(pbdev)); + device_cold_reset(DEVICE(pbdev)); pbdev->fh &= ~FH_MASK_ENABLE; pbdev->state = ZPCI_FS_DISABLED; stl_p(&ressetpci->fh, pbdev->fh); From patchwork Fri Nov 4 16:15:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621372 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp359213pvb; Fri, 4 Nov 2022 09:17:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VydEhLrFjkhCDN2eK+5UEgqJWlaSMdN4yRPnmwrj7qzO/w8eNvw/EKR66lHwd3Fh3HwlF X-Received: by 2002:a05:620a:4803:b0:6fa:a2ce:ac27 with SMTP id eb3-20020a05620a480300b006faa2ceac27mr39007qkb.185.1667578624962; Fri, 04 Nov 2022 09:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578624; cv=none; d=google.com; s=arc-20160816; b=zHZkheaNJ6ymcJmPH4QQlh/0c00jEYgVDG3D0Fxi2TRe/LjaZgsIcfngwhHt3YEE5F NTsz124RrkT9P6nS5GDaTzlpIjMluIubz+Pr6BJd0qMtpR/NLlxUfgOnhXpaEEa1nqYU nvWD5y4tdRiob6KoRZpaWqM8hkp5lDqwxaQ/YSKJXoGiLeSrHY3i2zujboiWSGYiI7KE OHDDoPIyCrBCB22l32HObRqMNw+C+1wn6y/Ad9Kavd3lFRJ6X6sxAR2JzhHaOgTOeXKh gCbWhwwKXGf0QXy4hQW3BePuuDtyh3UoK2vNIU+YwldNbApaMAGWSowPmeMv7FiDLLDa AVnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=dP2Tld0oNVBqsOOhbGZ6H70b01wO4+uA3tggm2gFq8o=; b=KSo9S167AyqTlUIB01+WfoSjEy7oZEDqhDt0B9mixZFiHFDSp5hvB6DfulBO8IIzWZ geBhpCKvmr5l/KHlxFNpgNDzrfbXYIaPE2dpZGfBJe5/ahKRyDhlg45FCxG/130xBKDW GyIbj0vS4zry4khCxd7pTVdYoAuTEMasUjxVb7qOBdGlZmML389QHgDeSJxVKg1tx+V5 LSlmS01QXTpIQbBJvKYc8dRO1bpAukLjuA19IjK7punMLEydFh8SHr2kM2pDPKHsk+pD Es2XTOz6yoS9Uf71TlRT3ziMjlBlNemlI/58V/MGKDvUD49StlDUAl8fvWWbni3I54yc p9Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g0JePzDP; 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 bk16-20020a05620a1a1000b006fa829a1e54si3100225qkb.28.2022.11.04.09.17.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:17:04 -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=g0JePzDP; 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 ) id 1oqzMf-00081U-IK; Fri, 04 Nov 2022 12:16:17 -0400 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 ) id 1oqzLq-0006RA-FU for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:32 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqzLl-0000fq-4d for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:24 -0400 Received: by mail-wr1-x435.google.com with SMTP id w14so7717890wru.8 for ; Fri, 04 Nov 2022 09:15:20 -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=dP2Tld0oNVBqsOOhbGZ6H70b01wO4+uA3tggm2gFq8o=; b=g0JePzDP7ePUMgHMcQADAmT2lwBB3O+X39g6Elncs0SaVE0inkoKthPLhYCg5VmHLN eD4T5/0t/VWUB2I+J2cqFwBXQeoEZ+Z5qAdtk9hWFGpNylkutoS1HdDdTQJaDoBQJlMo J5Vl5VAhB9aZZF6bTmepAXidn5P9ln8W23SEMBMawkg2/gDceJhEOt5WqDnjEp+Grj99 vNQ3C9uav20AY6B0a/OeEtrd6IUZke1zRtJi7zdHH3+V54oTpVvW2GEq6WVUK7vEWuS8 AdEWtgEv6GNc66IOQXqKTKerXiMGkKygTdN/ILzgXwpOWfVj5KoclyQQFWiNxED2+VBU XTMg== 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=dP2Tld0oNVBqsOOhbGZ6H70b01wO4+uA3tggm2gFq8o=; b=LnjoYI0CFyuMldUEK1TE/jMJmB6fnhO0DY+kgInesdLPQ0RNzSorpm7GRElyI8td3M RfidrtMT00J7GP1/7fcTTy0Ioc9HO7si30o+MWfd/md1YskuuEH9aZTvFKXqUOYIn1IT bk/Abco2VbndDelS+lgoL3yTqaNJcrCsoKpfqinUlS84ti5iu2UKqklS1QwTcTM3h4YN QBhHMM7sfEBcCmH8u7tCASOrZ/AU+KhLt2BgosAwaisqzhQ/vRb2hEPmetOWg+pK1V6i 3GYlIF1jzr22uhMG0COP/HY7B5sPppUqteXxYfkdtusenNdqIOt4nwyfcqYgzqrvs+WQ LO8g== X-Gm-Message-State: ACrzQf0DG6A9+UJnr77Oh+xZG17xJdqN/YDjIKUEHuaQDw7bM9Wt7cZr 4Lq44yrkNXlJaqlaopEppChSFCztZO6aZQ== X-Received: by 2002:a5d:4484:0:b0:236:574f:2536 with SMTP id j4-20020a5d4484000000b00236574f2536mr23839778wrq.7.1667578518947; Fri, 04 Nov 2022 09:15:18 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:18 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 2/9] hw/audio/intel-hda: don't reset codecs twice Date: Fri, 4 Nov 2022 16:15:06 +0000 Message-Id: <20221104161513.2455862-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.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=unavailable 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org 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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- 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, uint32_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) == 0) { - intel_hda_reset(DEVICE(d)); + device_cold_reset(DEVICE(d)); } } @@ -1083,11 +1083,9 @@ static void intel_hda_reset(DeviceState *dev) intel_hda_regs_reset(d); d->wall_base_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - /* reset codecs */ QTAILQ_FOREACH(kid, &d->codecs.qbus.children, sibling) { DeviceState *qdev = kid->child; cdev = HDA_CODEC_DEVICE(qdev); - device_legacy_reset(DEVICE(cdev)); d->state_sts |= (1 << cdev->cad); } intel_hda_update_irq(d); From patchwork Fri Nov 4 16:15:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621379 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp360900pvb; Fri, 4 Nov 2022 09:19:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5USWBYb0R53FqNA4klUBLHIu6Wi7d5mOCFmmoQrvVfI6/HGTTIkxqBdGyVtGbBjciKryhT X-Received: by 2002:ac8:5197:0:b0:3a5:416c:f5da with SMTP id c23-20020ac85197000000b003a5416cf5damr15073727qtn.81.1667578751616; Fri, 04 Nov 2022 09:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578751; cv=none; d=google.com; s=arc-20160816; b=BvjuYbjlzLV7cBBNVvqsfr1PMcOfSGbgqQeNNLRYK0ikTunZ66P4vYvvLJZYmPVgPH f1fpkkwMcZb/kAq6nKzPYxd1kG5sOTfb23jDFb3D5RmgWr1whErV04U6Lahg7CXIQeiz oR6KEQPpzRysSkC0/S/2eviRGUt7mSRmaSzBQOFN6RFHyjw4qnbMlFpunRip/pecSj00 4kK9WgS4mKaQJCxq0af7eYQoEebATRuVCoqysAIDSBOud7VMvooyO10TahP0H82F+t3b JOAQRHAlcqEG75rM+z53CRTBddf2ldLWmpixBxl0zvtiqIHRcVJKfk2N+uaGwMqQUElx e+LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=9hcZsgv1OlTjH0ZCrKa3WYUQGgMlxaCEIip18pDUCr0=; b=0OtI2e4jn0kU8QF5sxTCDqDafbW3DRO8HwCAV6/H9758SWnbgIQkUEKR/JBwcfbChp 5zex2jWedwWjP7KykQ5YRA8JJWNNf6xxQtZUfdg5aRqy873tl8CEEJ+C0qQe5ufJbtsV giEoaY4No0SjYl3CH4dobEuUZfbMvHarUbs9GZ1hppOBpUPzP6EekHL2WNpePKglB5we OZnIBgHiXPdEPWe8uoQbG/KEQo4WlR5Bl8l/Yzc73cKikx49GWW3C6wmE/WDJdUgac0g o1brvivWyMW2RJioUlFWz05KSwioCwP3xfUn7hMhuuMRUOM/iyFAyvC94AhZx1WemxPp oXvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R9RDXtUd; 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 x16-20020ac85f10000000b003a5069bdc63si3272663qta.86.2022.11.04.09.19.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:19:11 -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=R9RDXtUd; 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 ) id 1oqzMj-0008RR-Fm; Fri, 04 Nov 2022 12:16:21 -0400 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 ) id 1oqzLy-0006Vm-GU for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:40 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqzLm-0000gI-V6 for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:34 -0400 Received: by mail-wr1-x42c.google.com with SMTP id j15so7750443wrq.3 for ; Fri, 04 Nov 2022 09:15:21 -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=9hcZsgv1OlTjH0ZCrKa3WYUQGgMlxaCEIip18pDUCr0=; b=R9RDXtUd06YgEqBkF/nNO7fxZpIVnqqIZy+UyZdasTIVIV7kRkIThe6I8Aj1w9D3G0 Kmg6rqTsoUWaTLa1fzx4piUWN0Ox0B6Ro9tgoaXYvWsgevKm9irU4S1YpCtU6BXayN7c WhuwkRLMHccY0avGu9tRAgU5TGWMnm+JZ4EvM+seAuoISvL4c81wwB252V9IDrba+B0m Or5Oh4hSiIAMQj3Ttt8+8bBWc+0WvnsUn/4VkiUiqMSoFSRmioGZa936bz+ULFkJKTJn Y1yefPRVATjRIAoWPOJl28M7RIfIvloy+oPxHIo0CQyBX5VqCKxumWkBajhVBV27yybH i+Eg== 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=9hcZsgv1OlTjH0ZCrKa3WYUQGgMlxaCEIip18pDUCr0=; b=W2j95AYtjQ1W5QzJ+LuPPiIzXeyQSClErlwDhv+pdYEUmqleSadGYpQmeqOKFcXt5h RyFzvsCoWqacxTRSp3gq+XTyTQrvtWiLENZjOMfc7qWgEQUmiuz/WLztmdQ/LggsN70O fgEwvwYT2haddT3prZv8EpM1jaO03Y7+N4weTv+Z3HnOHGE5oODTvej3tYkHwjpcxaJi zvV3H0o0IQn6/3GVWZWgoH1LzhyBczp9h57NYg/Nc7yapCrOC8yAaKpiQnGNzr95kTGK wADq0QzIo6KM6dhbDwGUudJqMUAA9IlNHelobjoLYwDQSR8BzmcZYMHzsPn0GXVdwf/T 8ghQ== X-Gm-Message-State: ANoB5pklSQn5KlmKs/oUbcJKuiJGaso+fDTpp+RYI5o+lMqQtZkeWVeP lyghaadXWnbGfobnfK56GrXkwcqN5+y6GQ== X-Received: by 2002:a05:6000:1544:b0:23b:b7e4:b89f with SMTP id 4-20020a056000154400b0023bb7e4b89fmr1521168wry.163.1667578520320; Fri, 04 Nov 2022 09:15:20 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:19 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 3/9] hw/audio/intel-hda: Drop unnecessary prototype Date: Fri, 4 Nov 2022 16:15:07 +0000 Message-Id: <20221104161513.2455862-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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=unavailable 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org 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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- 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); }; -static void intel_hda_reset(DeviceState *dev); - /* --------------------------------------------------------------------- */ static hwaddr intel_hda_addr(uint32_t lbase, uint32_t ubase) From patchwork Fri Nov 4 16:15:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621376 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp360179pvb; Fri, 4 Nov 2022 09:18:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4x840hRsDCT8y/iBv1f9ATiE8yW+JZS9DxDBLqB+9rDjqBzn2avlCblTgkj4AQj1hES2Hl X-Received: by 2002:ac8:7353:0:b0:3a5:22f5:1f56 with SMTP id q19-20020ac87353000000b003a522f51f56mr23790875qtp.328.1667578693297; Fri, 04 Nov 2022 09:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578693; cv=none; d=google.com; s=arc-20160816; b=oesYXmTqxcKTsaYT5s4vVzsJ8hoe9LI3FsuLCoOC66B4Usls4ws1OdU5a9AFT4HwGm NXTzf/cMSoT5cc2w0VxCAhuwReTq9i+/ypF99G8k8VF2j0gCTRJmkfUffJ/Dbf4/a1fT KAGuYPjlyqQhKjgqn2NCUBBRZH+S+D6qv4mckkLS8EglX/9l5d2mqpqr5q24mAAylfJ7 z0a0pnL/G7uzBAe/eT+DkHRJbtviXgrjdRg86H6Xmxe2og6VA0SErugJDk2eArYinRee VBicEiiYT6/3HYrvPnHAEZmny4EFoIXC6J9x01LYlSwBAO+HHt0kr42VS0pDqa6pRlPl mVkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=DIssiaxZUXp9drHLMQc52wG6/fuhaHC1D5IXSogHJ7w=; b=vWHtLcxyTF9SAHgMFVYOebIPcy/MmaeAeouD3MKeezaO19PiTebssmYNsGRxHvVF0p z7a9SWonEWmzHmTGTZMbT0YlTeMCLjTDwrFrlj3wJltuMCTnW+Aw6EE3KaHMkhRGV+0i Rmd9LvjEq3UYR/oZsgn9mX0yEPp8QDFHNoDpJ+VsaO6kqc4OP7NxPts7Tlf+69b2VTz7 aEozNLMTqp5Vvaz2Gfc0nwdR2hdfA+CiePVYEAeq7l+sV6UxrEu2uz9GQnErE9ZAKkKs 5Xp/QBEVve544iPzC84BkVC6kYimmYOOuLjkGsXn6j2GBMzgxowNjolNwWuspX1BKGnr MVsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ufYS2Buz; 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 fv8-20020a056214240800b004b40ccfe68bsi3078554qvb.105.2022.11.04.09.18.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:18:13 -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=ufYS2Buz; 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 ) id 1oqzMk-00005X-8i; Fri, 04 Nov 2022 12:16:22 -0400 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 ) id 1oqzLw-0006UZ-QG for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:38 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqzLp-0000gb-Ss for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:31 -0400 Received: by mail-wm1-x333.google.com with SMTP id r186-20020a1c44c3000000b003cf4d389c41so5723209wma.3 for ; Fri, 04 Nov 2022 09:15:22 -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=DIssiaxZUXp9drHLMQc52wG6/fuhaHC1D5IXSogHJ7w=; b=ufYS2BuzYP8Jzkpt5M+0RiMNbz9d6olyUVYGOpGAPI2iroE7hpTev0qkF9qc4Z1Ngc 4myNvP8LxajOZIScEK9JjCwqHaoezNIVQnrIQu0eiuAb/KdPDRvDRvqLT46vp0LZy4Wr jU1J+41/5SSS9OuwM7nG+i0gizpWzBc5MX6C36LK4xXpPq90018Ruv7i0t/IO2Th9coc old4dPYAfiDJ/ZtjaFF/1GBCZGlmIhl0fIAe6sVME6t53H30sgNLIWlWMgZRM2qAUKsB Ies9pRhASBofBiWieNRYNApARN6rcKbP9WJ8Ud8oTSK0NaUk7pkZbHCe9bI7+0PcxGYx txYA== 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=DIssiaxZUXp9drHLMQc52wG6/fuhaHC1D5IXSogHJ7w=; b=7vy7NQuFfCeVcVkIhiBCrnsb0STyzo357VRe8ASKVJLFFDMZ8QowH2GJEqnkKAT79t T4sSADMoSM2eSERk03c/kwOuXtpp6JVj6MKtHmuHUx0nEKc2ac7iGjXX4DFZERi6LsDR YDj4VlIwPB/aW+DPKD8H3+jWli1qT766HhktHs+HOnx802lp3uEGngTIOBFW9GsiUfpq w8KXiCu7t9LOwG/2Fjsf8VVlLLFeVHuhsx6GtmvWEdyNME4IPPRqf0F2qLaKwOKYCkgg 1bcCsph7D+k7+nUcKGC85t158M0fesNAkKOlnvlRh/yqLai+rLrTM9TsE3T26vj8y5Ni ScmQ== X-Gm-Message-State: ACrzQf2MHXVauQpoLzbNB3fft0CnZnwkBHtfpPtHLV7jFp3PO4J3E9Cr AZDUs3/VEGpGzyqDxU1OyMKw53cyOc+MkA== X-Received: by 2002:a05:600c:3b22:b0:3cf:5eff:c858 with SMTP id m34-20020a05600c3b2200b003cf5effc858mr24416622wms.193.1667578521744; Fri, 04 Nov 2022 09:15:21 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:21 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 4/9] hw/usb/hcd-xhci: Reset the XHCIState with device_cold_reset() Date: Fri, 4 Nov 2022 16:15:08 +0000 Message-Id: <20221104161513.2455862-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Currently the hcd-xhci-pci and hcd-xhci-sysbus devices, which are mostly wrappers around the TYPE_XHCI device, which is a direct subclass of TYPE_DEVICE. Since TYPE_DEVICE devices are not on any qbus and do not get automatically reset, the wrapper devices both reset the TYPE_XHCI device in their own reset functions. However, they do this using device_legacy_reset(), which will reset the device itself but not any bus it has. Switch to device_cold_reset(), which avoids using a deprecated function and also propagates reset along any child buses. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- It's possible this might result in USB devices on the bus getting reset more than once (once via the descent-along-qbus and once when xhci_reset() etc manually reset each port), but in my testing with gdb I couldn't get that to happen. It should be harmless anyway. --- hw/usb/hcd-xhci-pci.c | 2 +- hw/usb/hcd-xhci-sysbus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index e934b1a5b1f..643d4643e4d 100644 --- a/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c @@ -85,7 +85,7 @@ static void xhci_pci_reset(DeviceState *dev) { XHCIPciState *s = XHCI_PCI(dev); - device_legacy_reset(DEVICE(&s->xhci)); + device_cold_reset(DEVICE(&s->xhci)); } static int xhci_pci_vmstate_post_load(void *opaque, int version_id) diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c index a14e4381960..faf57b47975 100644 --- a/hw/usb/hcd-xhci-sysbus.c +++ b/hw/usb/hcd-xhci-sysbus.c @@ -29,7 +29,7 @@ void xhci_sysbus_reset(DeviceState *dev) { XHCISysbusState *s = XHCI_SYSBUS(dev); - device_legacy_reset(DEVICE(&s->xhci)); + device_cold_reset(DEVICE(&s->xhci)); } static void xhci_sysbus_realize(DeviceState *dev, Error **errp) From patchwork Fri Nov 4 16:15:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621373 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp359215pvb; Fri, 4 Nov 2022 09:17:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AoC7P/+VcJsFvxFTRD8QTQb4xS5fQCqn9UyF5T8O7/u294mk2twzmhfRc0ADHkP8LBcP7 X-Received: by 2002:a05:622a:1826:b0:3a4:ae8c:6eb4 with SMTP id t38-20020a05622a182600b003a4ae8c6eb4mr29531558qtc.210.1667578625113; Fri, 04 Nov 2022 09:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578625; cv=none; d=google.com; s=arc-20160816; b=nlFrIKTXJLbCtdHuYVL6GBdd6Mfvp8hOoXfBiQ10aiH4KyeVK9YkPwCragiQV24o8q rTnHrK+E5+z/awZyweGwObLVeilPJgZmLb2WVCVPyVcsRWSAzriu5DCMayPKBuGXQ4bj BVrLeh4bUQfy0sG7ohO07s73T9vOPRc8DlxckFXIwIVLzkxuU3EIzUTvYLrVHUSTHEsX jLZ/ASO5jn9IDgxATi1nZ6UI3QLFZ/9HghkyN04HYHKdHSJyZrEQyN6JcRpVxaXRVGbD BGlHtAf2A/HuYsnD73Si2iCW6ZR5ocAj04NrSuY7oq0iC2y1rZetGzPHRBQ4jMvcjkOL 7I5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=gLOBIeXxFQHn8NKIeCIiWY2W/ASCn2XAaQBn9bK18Gk=; b=WExa25E186b7s4anyc168toAKvgbipnuhlhpxBe7r0XGUrTVZiMdtvhPTMHbY2fYhu 55NfQDKVoHJpBsQgk/BcZicw1unuVYrO8KfjFmfYGdVIvhBiubgYzYzumHZ5EKowxIip RTcArCUROiahtbf8+rCEuQQSPq++ptYEUDEGT3VKSYh+6rQpajn17mYF4d654RKwbsLJ Ppv/wQC/S/9b+GsbPvPHbBeJZTrRPTUO/OSKZjWMy/8ln7pm/iBLX7pp1dMwhRg9gv/L Xnht2bSfZNbFxLibei2pnrBnVFGtHZp8/xMg+z2v188YFN5Vn+9cyeTyj0Q/Jz7tM46o i4qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hcjfI/qZ"; 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 u7-20020a05622a17c700b003a516804c9esi2678286qtk.55.2022.11.04.09.17.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:17: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="hcjfI/qZ"; 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 ) id 1oqzMr-0000Uo-Gw; Fri, 04 Nov 2022 12:16:29 -0400 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 ) id 1oqzLw-0006UY-Qc for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:38 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqzLq-0000gt-96 for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:31 -0400 Received: by mail-wm1-x32a.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso5723837wme.5 for ; Fri, 04 Nov 2022 09:15:24 -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=gLOBIeXxFQHn8NKIeCIiWY2W/ASCn2XAaQBn9bK18Gk=; b=hcjfI/qZk3A4T50D5mS2JIIswiG49UGB/+QEiMArwm8MgVVtpcm6eFLeHaa0Q0BYpD 98McuAUVzjTObsgIOiXnhBG54qktzcS3xQzsTc+qrTL4RViVbf0mjfpQlmRcOFIURy/G w00uyHNdb+hm0QjzufqsC6RT06k4HFMWEEpRvHUw9fjBfgKwXe0kSxLMC6Ec7Jpe1fNx G9HGGh20YpnR+JbZFoI4Bft872pIM+CYb/O7dNkDCHGtfDFhrnXEx+JtjLifFgfzQtmf c65FHXac/VNlf3REXe7HMOyMA9AfF3jHICs6X6dZUcoakJlix6buD4LAcbt5PsPTEyJz DaUA== 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=gLOBIeXxFQHn8NKIeCIiWY2W/ASCn2XAaQBn9bK18Gk=; b=aLcYv6eYGKkwCRh7fHkB03Kv6hOSSMLdX5Z3SS09AMGnhKC6bbqGb24Cbou3UTcwpW Fw64VdFTmu8VZjf033yBU97XYU05V6Lnjc9QI9vc72WQ1ntCWQ0sfYHGFImeqTc91lUZ gYKkzwjQ/PFuTu1UpXKRgpOY9Lrc8xX1NVadvsG6CIbFYrGqsjn0BOZYfhdugFYfpJ7O 1JO9x9Z1QDnTfj2slNBcOT9tso1eaGEGS6SDdjGUnTI+1cOdP2D5Bu/3K0PZ1qNh7b5/ XV3/DdjqTpqqhV4KtkeLmIcIsoWlp7W8cDWEUAJT7yYqu2aVFYYv7PsbdJuPgp8NdnZ0 E/Pg== X-Gm-Message-State: ACrzQf3XQRlc2vOyw+0PePfZxogMf3lInEycu3XuCskgZRf6I55cZXYr 9LJOeaoa3ojqu8EVUs4inOsa/WyHc87+iA== X-Received: by 2002:a05:600c:46cd:b0:3c6:f5ab:d383 with SMTP id q13-20020a05600c46cd00b003c6f5abd383mr24932132wmo.40.1667578523201; Fri, 04 Nov 2022 09:15:23 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:22 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 5/9] pci: Use device_cold_reset() and bus_cold_reset() Date: Fri, 4 Nov 2022 16:15:09 +0000 Message-Id: <20221104161513.2455862-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org In the PCI subsystem we currently use the legacy function qdev_reset_all() and qbus_reset_all(). These perform a recursive reset, starting from either a qbus or a qdev. However they do not permit any of the devices in the tree to use three-phase reset, because device reset goes through the device_legacy_reset() function that only calls the single DeviceClass::reset method. Switch to using the device_cold_reset() and bus_cold_reset() functions. These also perform a recursive reset, where first the children are reset and then finally the parent, but they use the new (...in 2020...) Resettable mechanism, which supports both the old style single-reset method and also the new 3-phase reset handling. This should be a no-behaviour-change commit which just reduces the use of a deprecated API. Commit created with: sed -i -e 's/qdev_reset_all/device_cold_reset/g;s/qbus_reset_all/bus_cold_reset/g' hw/pci/*.c Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/pci/pci.c | 6 +++--- hw/pci/pci_bridge.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2f450f6a728..9d819cbe3b3 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -378,14 +378,14 @@ static void pci_do_device_reset(PCIDevice *dev) */ void pci_device_reset(PCIDevice *dev) { - qdev_reset_all(&dev->qdev); + device_cold_reset(&dev->qdev); pci_do_device_reset(dev); } /* * Trigger pci bus reset under a given bus. - * Called via qbus_reset_all on RST# assert, after the devices - * have been reset qdev_reset_all-ed already. + * Called via bus_cold_reset on RST# assert, after the devices + * have been reset device_cold_reset-ed already. */ static void pcibus_reset(BusState *qbus) { diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index da34c8ebcd1..b2b180edd61 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -275,7 +275,7 @@ void pci_bridge_write_config(PCIDevice *d, newctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL); if (~oldctl & newctl & PCI_BRIDGE_CTL_BUS_RESET) { /* Trigger hot reset on 0->1 transition. */ - qbus_reset_all(BUS(&s->sec_bus)); + bus_cold_reset(BUS(&s->sec_bus)); } } From patchwork Fri Nov 4 16:15:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621370 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp358599pvb; Fri, 4 Nov 2022 09:16:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wM5/pW/r86/CYYWBIhBl59ivfXlAIb/FpR0M8jY2eF67eUkUvok9Iqpq9tmRxscSJy9Uo X-Received: by 2002:a05:620a:9d5:b0:6fa:d03:aa03 with SMTP id y21-20020a05620a09d500b006fa0d03aa03mr26318025qky.453.1667578577567; Fri, 04 Nov 2022 09:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578577; cv=none; d=google.com; s=arc-20160816; b=X0cIyBdt95usRT8g0mHUYMhyKjWzmjMtWnWEUHAIX+K5VApcyW59uHpocplMjwRGWQ MA3AjZPYtMGO0Kl0rW5N3k8o1vL1Vq/U3yiCOdhcaVx6wnuEpPjETfJxkn0K0M0edTCM hVI0TJtdob1wdHRUKCAeG/HKeL9UIyd5aYIMWtFW0K+GS8WLq//k7TtCNmUrLaZEau7l rYD4Uhe7vmqXeqoDlfDCkX/qlXRJTflxVlP1C1CZhSlgapKtoArh2CsPFjpyfaXYC3cW sBHeaB9CiLW5TzvB1wTaXTnHKREpLONZy1CMtC6rbckoS6aSgNmu5OnXYCjUxIHf77qx J2Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=uG5SydxIxnzXe0zp1rVqhMwUuqy9ImGn1CKFVjwW+XQ=; b=FLP/02Livjq/G9rLd1M5Io0omllbOV/dfshBpH4eB92vJ/qRiSQCafaVDC1nJLUlg/ /DC9dSaNaUCdEmtH5YKkLVRQLD0Y0CiBdzDWSqLNecK1tSHhXGHEswpYx1t7nILgBUjQ 90WIOk0zK5A2+PnagAPnuH4qMyyqUGHX6otus8mHebdNQESb8ZzQkYwSuxr+2zlXkwDl /otQU02DLFEi1mfcDt8vDgXtJXSW7vlF6Q/Xjvn1z8WO7x5bG/RJ3Dq92QHhEP0wDAxn O7d/ejJaK0OMv2ixRJluJFXUCKnJcmALVRsnv4foizfhQ6x6KSqAoaVBsBeJd2+/zlUC Dfmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f6AiWZfG; 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 ke24-20020a056214301800b004af9a0d2479si2749814qvb.6.2022.11.04.09.16.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:16:17 -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=f6AiWZfG; 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 ) id 1oqzMF-00076s-GJ; Fri, 04 Nov 2022 12:15:52 -0400 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 ) id 1oqzLx-0006Ua-11 for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:38 -0400 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 ) id 1oqzLq-0000h9-9U for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:32 -0400 Received: by mail-wm1-x32f.google.com with SMTP id m7-20020a05600c090700b003cf8a105d9eso3469809wmp.5 for ; Fri, 04 Nov 2022 09:15:25 -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=uG5SydxIxnzXe0zp1rVqhMwUuqy9ImGn1CKFVjwW+XQ=; b=f6AiWZfGjfV7sC62uy+i3tQqAbE4yiuhdFonGVNorS5TVGNgIIjrjdeqPGgHBir6CB Bcgq+RmD7nxhEsel5mayWoLui9skUdvI7bjhr841x2U0v/JH7gPcjb1CxoM/e7gT3DPc 7Sxw68q9KUIHJW4jFKEzAM6dY8+/e+ZsVX7vXDCQxz9xeCitA6FJS+SvG/K+UfwHw+yw nWGNyFk+Gnn3WudySZLvh72YXeZm0k/xcZnKrbIEN6spFwZEEHwXLH2sNUUkwTzj0nGk OXDM5+KnpBcRpjmNW73tFhAwMrUWBPIjFro1fHorsUIOkkUBzR/HSjp/laLcGZRk3sSN LnkA== 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=uG5SydxIxnzXe0zp1rVqhMwUuqy9ImGn1CKFVjwW+XQ=; b=sOMS0/4Pb6sQ+4Mb/steNFhFt9I9qcijmTWUUEoEEetnCVDcWi0QZyFZcl/VvAl+V6 yaApZmvGqyWLsN5Y46+CnRvQrpYxIJ4MJlvar60IjyIC8a6jnVKjlJC7LsIl783fMD4S cZZn7NaY1VPlpPcxcUoJa1jq96mr+KpMRbl0kwlbSioebXs0FH6n3NVPs9baC2pW7OMc 70jinehyskBRvhxwDO3y4+72mm4zEioXN3NYPrxN8cr2sJ20Em4z6ZzaD3HiXLNqb8Uy f4aohLlj2rae8/WdfYtjvt0b27ME+15PKUWuXv/6y4qV2sLcpPR/3j921jWPvwZNm9hq o3Bg== X-Gm-Message-State: ACrzQf1kqcQ7QJQH10/h8txU4jdkGluS3E3wEI1sxQIidK4Ysk9nxnUd ZQFH8kssHWpSTOqVDlqGYOQYk6qMVChUwQ== X-Received: by 2002:a7b:c009:0:b0:3cf:6b95:73c8 with SMTP id c9-20020a7bc009000000b003cf6b9573c8mr21109806wmb.121.1667578524612; Fri, 04 Nov 2022 09:15:24 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:24 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 6/9] hw/hyperv/vmbus: Use device_cold_reset() and bus_cold_reset() Date: Fri, 4 Nov 2022 16:15:10 +0000 Message-Id: <20221104161513.2455862-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org In the vmbus code we currently use the legacy functions qdev_reset_all() and qbus_reset_all(). These perform a recursive reset, starting from either a qbus or a qdev. However they do not permit any of the devices in the tree to use three-phase reset, because device reset goes through the device_legacy_reset() function that only calls the single DeviceClass::reset method. Switch to using the device_cold_reset() and bus_cold_reset() functions. These also perform a recursive reset, where first the children are reset and then finally the parent, but they use the new (...in 2020...) Resettable mechanism, which supports both the old style single-reset method and also the new 3-phase reset handling. This should be a no-behaviour-change commit which just reduces the use of a deprecated API. Commit created with: sed -i -e 's/qdev_reset_all/device_cold_reset/g;s/qbus_reset_all/bus_cold_reset/g' hw/hyperv/*.c Signed-off-by: Peter Maydell Reviewed-by: Maciej S. Szmigiero Reviewed-by: Philippe Mathieu-Daudé --- hw/hyperv/vmbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c index 30bc04e1c4c..f345f310b0f 100644 --- a/hw/hyperv/vmbus.c +++ b/hw/hyperv/vmbus.c @@ -1578,7 +1578,7 @@ static bool vmbus_initialized(VMBus *vmbus) static void vmbus_reset_all(VMBus *vmbus) { - qbus_reset_all(BUS(vmbus)); + bus_cold_reset(BUS(vmbus)); } static void post_msg(VMBus *vmbus, void *msgdata, uint32_t msglen) @@ -2035,7 +2035,7 @@ static void vdev_reset_on_close(VMBusDevice *vdev) } /* all channels closed -- reset device */ - qdev_reset_all(DEVICE(vdev)); + device_cold_reset(DEVICE(vdev)); } static void handle_close_channel(VMBus *vmbus, vmbus_message_close_channel *msg, From patchwork Fri Nov 4 16:15:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621375 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp359997pvb; Fri, 4 Nov 2022 09:18:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6HHHE/023i8Dw/zXx+OBsMNlrwxumbFz8MpQOOEremLHE6ScY+TD1dNNZUgC3GyfrHtyn6 X-Received: by 2002:a05:620a:1359:b0:6fa:3241:52a2 with SMTP id c25-20020a05620a135900b006fa324152a2mr19326282qkl.95.1667578682274; Fri, 04 Nov 2022 09:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578682; cv=none; d=google.com; s=arc-20160816; b=HBCYxzEnMZ70xKQ6lkXDFeNGSiHiP4xzeFbr1mXej2UQTTLIJNKTrqZ+AJiquUw8rw YopA9sNIBjXXtft3Y8EAqaMtyxIE6w9OJsHw/HGvPv/ismClcsHoz7zW2UtQIiuvrLq4 fBeIFuTUuCFyZ24TQ5Xd9wx7vSdLEzmDuvjKyyQjsJj0qJGdnfRsMUfS7yggYwVx5q2i yKLzH9IUudqAwZwQdA/A1qFSxncGzlqFUwSjdd+xD7LlCsh+zkOWfJU6Szxjji/J6QAM 7cWTtP9tXQyEzBapFK1AVDcrmrQYvX5B3tpeIlkBdXQY8VycrLaoU82MCRHINt29qDw3 01VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=sTkwi7Kgw/qzL36aV64p1zqgyIMatepywYUB/dB5ZGQ=; b=qhqBFEonOm4hSkcc1L7NiK4ul6OLNDs/QOStjX7nN/PFJInOTu/gQuPeXbI7LUmbA1 +jcHe0TtbuPFtzPAX/xn3RiAvb6bHeNfrnyr3+7P+gAhBFXgHj46KWcosPSGY1orhsiH h5P6alAeuhHrPxX6ZbRKjSCUR+oZoRu6LgrV5OzF0g4oRBTUnAG9OvHFIx3NZiwWSWMr yZmvQqhlIn3ZhH9xTNHMkXvNGIZVGorUnoc0MFSTU8mpavwesQcjbnszfG90qSJ4RA7x gc14ZXqlos0N0LpaJ+ANCKqiNXOf8UcZ6dpCv/i5UGUPgBC2NABYf0cVZ86Ouuwig6P/ +JkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=re9Ld2U7; 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 y19-20020a05622a165300b003a51caead03si3132460qtj.664.2022.11.04.09.18.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:18:02 -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=re9Ld2U7; 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 ) id 1oqzMd-0007iv-CT; Fri, 04 Nov 2022 12:16:15 -0400 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 ) id 1oqzLy-0006Vq-Gh for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:40 -0400 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 ) id 1oqzLr-0000hh-GT for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:34 -0400 Received: by mail-wm1-x32f.google.com with SMTP id a11-20020a05600c2d4b00b003cf6f5fd9f1so3486392wmg.2 for ; Fri, 04 Nov 2022 09:15:27 -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=sTkwi7Kgw/qzL36aV64p1zqgyIMatepywYUB/dB5ZGQ=; b=re9Ld2U7i0MrouSpvW7FQHSDE76UKP1JTox3T+A4joPvemuAMZkuuR5UtrBOmcfPG7 XXKPW7rFkG0rl116yUERt/Q7QTtXfeJ2NrxoHNUkU/nss0pO8tczCL33k5P+nYEG6BJs 9F0m126CqU0d0sHOHX/xR+AkoHm4Me7pdPP6NxGnXW+KQQ4H6Z+JKfQpYd8xQMpK6Cni XOZ6zsoiBT5hi9rp2UWm/lFdxx4ssskcXRdlxNHvMzsbdy1VrQzDw5tMos3HA7OQV8JR ilODHt/AUbSAhXjjHu3AnNDXJ+J28acBGDueihSSPXPi37kgv42E++24ZJZaIVH6hxQT LzvQ== 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=sTkwi7Kgw/qzL36aV64p1zqgyIMatepywYUB/dB5ZGQ=; b=DWaE5mydWhmO/46WfNG0oWcXsbOC9z64WLdldNUHeFhBAEjB0yYS388TiXHDZJzY4j 5fH3ca3RXaGJl+gxifJe0Is5BntchBceAEDXp6wuJ1FACI8sAj1h2xbz9zn/4q/+6z7C 9yJfCTofJHpxy4LeFURyA/srIQW6aroKM7T7VDirM1wVloZrYNxXe6Eg8tNTwUkvEBM7 XlZC1Pn87vAq8GfLfKtiqFhD/sJrdXuTfBm8HupweikjZtNP83Tcf3YpjzuH5uV0D/jE AcSHJDV9Y6CCbTwt7+2bIwaRbOZJljlSe3hmJSooM27DInSOLpLu6Px8oG0L2WPNhQnw GrGQ== X-Gm-Message-State: ACrzQf2OcmYgMpfNKY4J7KXTwwwQhzhVEeccgNvNasRojk9M/uQF6R+w PlCetQz7YFgYoXCIuzxRKcUga7XkX+e22A== X-Received: by 2002:a05:600c:1f11:b0:3cf:73f0:b753 with SMTP id bd17-20020a05600c1f1100b003cf73f0b753mr17848736wmb.100.1667578526126; Fri, 04 Nov 2022 09:15:26 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:25 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 7/9] Replace use of qdev_reset_all() with device_cold_reset() Date: Fri, 4 Nov 2022 16:15:11 +0000 Message-Id: <20221104161513.2455862-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org The legacy function qdev_reset_all() performs a recursive reset, starting from a qdev. However, it does not permit any of the devices in the tree to use three-phase reset, because device reset goes through the device_legacy_reset() function that only calls the single DeviceClass::reset method. Switch to using the device_cold_reset() function instead. This also performs a recursive reset, where first the children are reset and then finally the parent, but it uses the new (...in 2020...) Resettable mechanism, which supports both the old style single-reset method and also the new 3-phase reset handling. This commit changes the five remaining uses of this function. Commit created with: sed -i -e 's/qdev_reset_all/device_cold_reset/g' hw/i386/xen/xen_platform.c hw/input/adb.c hw/remote/vfio-user-obj.c hw/s390x/s390-virtio-ccw.c hw/usb/dev-uas.c Signed-off-by: Peter Maydell Reviewed-by: Paul Durrant Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/xen/xen_platform.c | 2 +- hw/input/adb.c | 2 +- hw/remote/vfio-user-obj.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- hw/usb/dev-uas.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index a64265cca07..7db0d94ec28 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -177,7 +177,7 @@ static void pci_xen_ide_unplug(DeviceState *dev, bool aux) blk_unref(blk); } } - qdev_reset_all(dev); + device_cold_reset(dev); } static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque) diff --git a/hw/input/adb.c b/hw/input/adb.c index 84331b9fce6..214ae6f42b3 100644 --- a/hw/input/adb.c +++ b/hw/input/adb.c @@ -43,7 +43,7 @@ static const char *adb_commands[] = { static void adb_device_reset(ADBDevice *d) { - qdev_reset_all(DEVICE(d)); + device_cold_reset(DEVICE(d)); } static int do_adb_request(ADBBusState *s, uint8_t *obuf, const uint8_t *buf, diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index c6cc53acf2d..6ff14e0b9c0 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -685,7 +685,7 @@ static int vfu_object_device_reset(vfu_ctx_t *vfu_ctx, vfu_reset_type_t type) return 0; } - qdev_reset_all(DEVICE(o->pci_dev)); + device_cold_reset(DEVICE(o->pci_dev)); return 0; } diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 806de32034c..13a9ca62800 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -110,7 +110,7 @@ static void subsystem_reset(void) for (i = 0; i < ARRAY_SIZE(reset_dev_types); i++) { dev = DEVICE(object_resolve_path_type("", reset_dev_types[i], NULL)); if (dev) { - qdev_reset_all(dev); + device_cold_reset(dev); } } } diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index 5192b062d6f..88f99c05d53 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -791,7 +791,7 @@ static void usb_uas_task(UASDevice *uas, uas_iu *iu) case UAS_TMF_LOGICAL_UNIT_RESET: trace_usb_uas_tmf_logical_unit_reset(uas->dev.addr, tag, lun); - qdev_reset_all(&dev->qdev); + device_cold_reset(&dev->qdev); usb_uas_queue_response(uas, tag, UAS_RC_TMF_COMPLETE); break; From patchwork Fri Nov 4 16:15:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621378 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp360195pvb; Fri, 4 Nov 2022 09:18:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM723j2yLavpoB76cjbFU0WSQwB31McGSF/g1AFa8k1jDcTryIha8fwrQCZM6V17cSBHviw1 X-Received: by 2002:a05:6214:f25:b0:4bb:b5dc:63eb with SMTP id iw5-20020a0562140f2500b004bbb5dc63ebmr32901684qvb.55.1667578694590; Fri, 04 Nov 2022 09:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578694; cv=none; d=google.com; s=arc-20160816; b=FcwrGObl9Y7JD+nCrmoLHrAhtz1iRD1h1asbl+Nty2jNAkgUwSxU4esDN70z4EQyoi gwgGCKKx8s8m+sBfzjSZOEjU1Yb51n+owNYP0pmS3d/IYlcclJRVZxmDgzz2V25EmsdB Z3TIJbqyWh2FTB+9xcV/L+9GMv+F7VuPEbVq4jC9mNd3BDJDTPjU/k4pydIhrvdGuKV5 gSpU8A4Wp4US0eNYyVIjkJzWhOL8l+UvpwWAma6RXdQZbegm21PfToeVzBatjXmerQ3v DAcFv5kwMzUwYc0zxzMWPCqeJG1h1kPAEKd8aDk5rwz8N8tipBu/NLr1lyrf5CKrigiJ /wQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=HvsbSFL9/X7+hG+QCwobd7oX/Vj9erH1J5f0aYS/jDg=; b=nzY2jrkRh62Px1y8TpqldOIdg7sqLJ/qHsz+wbjDDqt0NfZlO4lSJNFmYn4Nj4Y/zw GWOm9PgipKP5nas5S/TNUxP+zWQ5lMZnI1RL7BvAFAlajmFPEqP4FaE9d9hdbDQVzUV/ NlWDaZomAJsmURgpz6dq0IkRlKvlzhzZTgmrsjvAXAm/de52j9edvcukTDKwwAgdfvPG xrYohJdeA+LoNglsP7Hzysivn+PHTzNN/g4YbJ6IuLU0CTmVgsy2fj5y24kVuKJuwEGm UP40LKOzVhvqzdAXlV4VDHB27jTFJwd9RBaJskqZiqSILD+3P7hfcbBDhWN0JAXmncD7 hVCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mhw6Qbus; 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 q65-20020ae9dc44000000b006fa32a26439si2725597qkf.711.2022.11.04.09.18.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:18:14 -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=mhw6Qbus; 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 ) id 1oqzMt-0000km-57; Fri, 04 Nov 2022 12:16:31 -0400 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 ) id 1oqzM6-0006lq-VV for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:43 -0400 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 ) id 1oqzLt-0000i3-63 for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:42 -0400 Received: by mail-wm1-x32f.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so3499150wmb.0 for ; Fri, 04 Nov 2022 09:15:28 -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=HvsbSFL9/X7+hG+QCwobd7oX/Vj9erH1J5f0aYS/jDg=; b=mhw6QbusoIMNJKftAzbRjxbwF66YGlRfvYgnJWtAqu8XoAjznJ1Wx5eTqlXv10X2X3 bVoHZ+9sVlA6b3y9DRByq1HJHvuy17SzWSxSX64KQBMrt4ZaChS1QDgkNCTrR9fcYRoZ tGSM6IvPK5K2RJfUg+s2gS1QzvdM8u7jyFjL/Br2PAIzV5Bw8pw9f41CDhJQ46nIy5uR iSRZwRBXa4w2eIMZi9EnlUKSY9cg9diSlnSOvMpvMI4EogiW9u+UHQIK1aazOoQMYn/f s1mHpbjYs1g88fbt9oMWQJLKXRzmE1rZjVJYTmkjr2OB2TYtX0INHTrecPA8YiMZkE4P elXg== 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=HvsbSFL9/X7+hG+QCwobd7oX/Vj9erH1J5f0aYS/jDg=; b=vw/BF2gIcpTCyFq9cDFH6QyMNX02gaH7o/zMJb5lnYbo/bjatWrJAEfIP7tblhkai6 wAuaSZgQTJhquWuiTI1bvkcsJe5rHtldlaGhQ/yt1UO+sseVt+a8iBA6gbh7P4UbylUY E/yPaoCleF1jrEfvBEqDpkR6yVpUdjUqwrISw25l1jt8u3SruRjC3OrcSoISxfTsqib1 jp/7gxVQCIlUh1uI7Jyr9Cjsr8G9vPbxhtTaUbtnoMMre3Gabe6teKJuWo+KBeqbI2NP ifeVbIWScSkndzA1lZYlHH9njzNrooC0MCFPR0YM6izIJWbFuTkI2y81IwmnwAwmxg0B 4IKw== X-Gm-Message-State: ACrzQf0GnvfLEPT7p6V6opJaWKbUPTSwLLs5ESTB39r0F0kgmmigmZhl L5OZ0HsxmIFfcg5mZ9r08OzD4hMQwbZ+2g== X-Received: by 2002:a1c:25c1:0:b0:3cf:4dc4:5a97 with SMTP id l184-20020a1c25c1000000b003cf4dc45a97mr31960218wml.147.1667578527696; Fri, 04 Nov 2022 09:15:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 8/9] qdev: Remove qdev_reset_all() and qbus_reset_all() Date: Fri, 4 Nov 2022 16:15:12 +0000 Message-Id: <20221104161513.2455862-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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 autolearn=unavailable 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Remove the qdev_reset_all() and qbus_reset_all() functions, now we have moved all the callers over to the new device_cold_reset() and bus_cold_reset() functions. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 26 -------------------- hw/core/qdev.c | 54 ------------------------------------------ hw/core/trace-events | 4 ---- 3 files changed, 84 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 785dd5a56ef..c7eda169d78 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -743,32 +743,6 @@ int qdev_walk_children(DeviceState *dev, qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn, void *opaque); -/** - * @qdev_reset_all: - * Reset @dev. See @qbus_reset_all() for more details. - * - * Note: This function is deprecated and will be removed when it becomes unused. - * Please use device_cold_reset() now. - */ -void qdev_reset_all(DeviceState *dev); -void qdev_reset_all_fn(void *opaque); - -/** - * @qbus_reset_all: - * @bus: Bus to be reset. - * - * Reset @bus and perform a bus-level ("hard") reset of all devices connected - * to it, including recursive processing of all buses below @bus itself. A - * hard reset means that qbus_reset_all will reset all state of the device. - * For PCI devices, for example, this will include the base address registers - * or configuration space. - * - * Note: This function is deprecated and will be removed when it becomes unused. - * Please use bus_cold_reset() now. - */ -void qbus_reset_all(BusState *bus); -void qbus_reset_all_fn(void *opaque); - /** * device_cold_reset: * Reset device @dev and perform a recursive processing using the resettable diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 0806d8fcaaa..3b0f04c5c6d 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -237,60 +237,6 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, dev->alias_required_for_version = required_for_version; } -static int qdev_prereset(DeviceState *dev, void *opaque) -{ - trace_qdev_reset_tree(dev, object_get_typename(OBJECT(dev))); - return 0; -} - -static int qbus_prereset(BusState *bus, void *opaque) -{ - trace_qbus_reset_tree(bus, object_get_typename(OBJECT(bus))); - return 0; -} - -static int qdev_reset_one(DeviceState *dev, void *opaque) -{ - device_legacy_reset(dev); - - return 0; -} - -static int qbus_reset_one(BusState *bus, void *opaque) -{ - BusClass *bc = BUS_GET_CLASS(bus); - trace_qbus_reset(bus, object_get_typename(OBJECT(bus))); - if (bc->reset) { - bc->reset(bus); - } - return 0; -} - -void qdev_reset_all(DeviceState *dev) -{ - trace_qdev_reset_all(dev, object_get_typename(OBJECT(dev))); - qdev_walk_children(dev, qdev_prereset, qbus_prereset, - qdev_reset_one, qbus_reset_one, NULL); -} - -void qdev_reset_all_fn(void *opaque) -{ - qdev_reset_all(DEVICE(opaque)); -} - -void qbus_reset_all(BusState *bus) -{ - trace_qbus_reset_all(bus, object_get_typename(OBJECT(bus))); - qbus_walk_children(bus, qdev_prereset, qbus_prereset, - qdev_reset_one, qbus_reset_one, NULL); -} - -void qbus_reset_all_fn(void *opaque) -{ - BusState *bus = opaque; - qbus_reset_all(bus); -} - void device_cold_reset(DeviceState *dev) { resettable_reset(OBJECT(dev), RESET_TYPE_COLD); diff --git a/hw/core/trace-events b/hw/core/trace-events index 9b3ecce3b2f..d6ab5c74b90 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -3,11 +3,7 @@ loader_write_rom(const char *name, uint64_t gpa, uint64_t size, bool isrom) "%s: # qdev.c qdev_reset(void *obj, const char *objtype) "obj=%p(%s)" -qdev_reset_all(void *obj, const char *objtype) "obj=%p(%s)" -qdev_reset_tree(void *obj, const char *objtype) "obj=%p(%s)" qbus_reset(void *obj, const char *objtype) "obj=%p(%s)" -qbus_reset_all(void *obj, const char *objtype) "obj=%p(%s)" -qbus_reset_tree(void *obj, const char *objtype) "obj=%p(%s)" qdev_update_parent_bus(void *obj, const char *objtype, void *oldp, const char *oldptype, void *newp, const char *newptype) "obj=%p(%s) old_parent=%p(%s) new_parent=%p(%s)" # resettable.c From patchwork Fri Nov 4 16:15:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 621374 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp359933pvb; Fri, 4 Nov 2022 09:17:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fJuI58kclulQ1U7Ol4GqLzEPRCVHB8kNRfcmDozLKw/ZJyjYVAWnJ2vuCNr6RvqewDyZw X-Received: by 2002:ac8:4f01:0:b0:3a5:54e2:4e1c with SMTP id b1-20020ac84f01000000b003a554e24e1cmr7176076qte.63.1667578678336; Fri, 04 Nov 2022 09:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667578678; cv=none; d=google.com; s=arc-20160816; b=Y3XsTQHUZ3LzjEv6qT4HNfrLZZCJNfv/8Ax3KbSlM1a+razEiKAzNJJeG6xo0XcsRl 9h3IJHUtllwrp6+5vZ8dkgXbrkPGnt5WQSXw5l5ZlCdMgWGt15TxvAt2xtxMrOcsMFJY 41TyZJap6kkyOdiZR+k1pK+T0gBinxFECteCP5/M9R1aib+HZbrftWA92hjL/4Yacmd2 dMlcGo6qwkHcg4Ww6ftne1Y1BD80fXCerUwgbDxPK5CYJ2RLROHjA86Kb1Y2/2eoA3wA zjh6HADgDmGXL7n+Ia41CS+gLZi4Ustb1libxl41TsKcA8gOI54NkTNUoIZh2HVEJwOc 8akA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=LgwWUCq9zFhY/xMo6SS9MgYNo0IB4SrVXfC493SuMF0=; b=LuR3tp6cO67et5z1G5JF1p2odfEa8jZtQ+jfgYZcRVueLmKYgzizHT9d6UYLIoBt1U w+iogLzfPbV2Ia2RK5lSC/L6gf/YuXGdvHBwQqrvHgrIkmcuQipJTPlkymBXkBvdBsLT I0xyXqAwvXNgIyNrvODYGIgNW1UB5FkY3ubU4hffAOY5KD3y4nI8V5cdCX555kqrh+v+ 4wS/wnW4QYlB6rMrjftOK5dl2p1fLsAoerycJrmVf3LOrJYj+BwJx2ybUCb4NCHScatf ec+cZ3eSZSLUXQY5JHIab8IAz2AUnqLiHXXVQyUqgr178PI2TLKkxJrz7/b471Yyt6E0 SHNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YY3iouWo; 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 iv7-20020ad45ce7000000b004bbaffc8591si3082770qvb.512.2022.11.04.09.17.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2022 09:17:58 -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=YY3iouWo; 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 ) id 1oqzMe-0007pv-22; Fri, 04 Nov 2022 12:16:16 -0400 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 ) id 1oqzM1-0006WF-Q4 for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:41 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqzLw-0000iF-E4 for qemu-devel@nongnu.org; Fri, 04 Nov 2022 12:15:37 -0400 Received: by mail-wr1-x429.google.com with SMTP id o4so7744497wrq.6 for ; Fri, 04 Nov 2022 09:15:30 -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=LgwWUCq9zFhY/xMo6SS9MgYNo0IB4SrVXfC493SuMF0=; b=YY3iouWoz76g+Hk0iylTL3vOsBfGKqg7n38dfcJafUcKJYmnT5KFf4Xxt0oBnxeyzx 0GbXyA5MlFk9236AWpsqEiMAPzpsK2ewwR9oNFCfyOFxlIqB5t7DweesP34RP3dO7wA8 YMelY6Q7J/ZLdgs/mh1RNyNbakvM3Gl1sS3GH0OCi1494MS4YhmT7alLALpnL0kfpHA9 skob8Qdn5gNtuv87hJo9vPSF+Jm/6d1yAo8v6wBjawyubV7dDfU1YcMFlaxhNt1yDX4P 6CcLyE3SqPk0k1HGKuquusyFKOm/MFXMOnzCQKMW67/7d9iscQRSvTCKoD49kuIRfZ4r RE8w== 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=LgwWUCq9zFhY/xMo6SS9MgYNo0IB4SrVXfC493SuMF0=; b=IW5+2Gcman2tkgv/soyjaLLCotKLhB2tDsthb10HCvvle6kiscbAcLwdPId3nmqkRy 9f/4oZjml2gDjZmsgtbfg6fH/QbWTUfkEKEPkO9j8wweidNEPHgcTzeTvOUizgnwWRmh 2UqnBoClQhMPPqmcd1JT6iecllV5Nebp0t9xrdq4Nr+c0D7rfk/PC7lfFB5ea7Upa1xl BfsSEz2Fa1h/UthCuyb0qscvmO9bQ50v5gfiTEnLr6RllKMCieh8NbjqgsiprB/6Bno1 oLLFCUO0j72ZXYMZlbqMcj1bbNiJXtEl9cCYM1cAdPX/wTJLbt+CBBIProjMFypLI8mK CCkA== X-Gm-Message-State: ACrzQf1UboSCFN72d3IWr83+ON6Ewy9QvkiCoW/DG+qkinei0wjud2nQ ml0k9u2K8vFU75haCOYJcXB2/R2aTkeYbw== X-Received: by 2002:a5d:59af:0:b0:236:6b90:1e65 with SMTP id p15-20020a5d59af000000b002366b901e65mr22964926wrr.362.1667578529175; Fri, 04 Nov 2022 09:15:29 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ay5-20020a5d6f05000000b0022e57e66824sm4649645wrb.99.2022.11.04.09.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 09:15:28 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Mark Cave-Ayland , Matthew Rosato , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0 9/9] hw: Remove device_legacy_reset() Date: Fri, 4 Nov 2022 16:15:13 +0000 Message-Id: <20221104161513.2455862-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104161513.2455862-1-peter.maydell@linaro.org> References: <20221104161513.2455862-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.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=unavailable 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org The device_legacy_reset() function is now not used anywhere, so we can remove the implementation. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 9 --------- hw/core/qdev.c | 10 ---------- 2 files changed, 19 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index c7eda169d78..35fddb19a64 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -776,15 +776,6 @@ BusState *sysbus_get_default(void); char *qdev_get_fw_dev_path(DeviceState *dev); char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev); -/** - * device_legacy_reset: - * - * Reset a single device (by calling the reset method). - * Note: This function is deprecated and will be removed when it becomes unused. - * Please use device_cold_reset() now. - */ -void device_legacy_reset(DeviceState *dev); - void device_class_set_props(DeviceClass *dc, Property *props); /** diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3b0f04c5c6d..2743191efe7 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -857,16 +857,6 @@ void device_class_set_parent_unrealize(DeviceClass *dc, dc->unrealize = dev_unrealize; } -void device_legacy_reset(DeviceState *dev) -{ - DeviceClass *klass = DEVICE_GET_CLASS(dev); - - trace_qdev_reset(dev, object_get_typename(OBJECT(dev))); - if (klass->reset) { - klass->reset(dev); - } -} - Object *qdev_get_machine(void) { static Object *dev;