From patchwork Mon Aug 19 22:51:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 820290 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c8:0:b0:367:895a:4699 with SMTP id m8csp1653528wrb; Mon, 19 Aug 2024 15:54:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXkHePDD219br0bNvP1ZpJpDn6ugqpmSDvyg9+K3mB9k/sQcqY+1HR22SJsSqgiGtmf/qNrtA==@linaro.org X-Google-Smtp-Source: AGHT+IHVuf+mZWjpjyHgLkJE91nV1aEuVXcTLT4wAJ8BpWWanxKhHxXofexcP8lBjj25Ad2ivT9S X-Received: by 2002:a05:6214:3b89:b0:6b5:61:53a9 with SMTP id 6a1803df08f44-6bf7cdedd3bmr115703546d6.28.1724108069180; Mon, 19 Aug 2024 15:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724108069; cv=none; d=google.com; s=arc-20160816; b=hViY/lGtPENr8n+7PMKVK/dMxxB2LJRQd0iZRsHG7NQ39AJl1DXs0tYsWvVKhmIJ3t 6Bqrqm7wcU1X9eVjKgZLjKP5GPtE/46Q98WE3eKQchLqvjK5hyRBQjeiAC78XUZu+mOo VlyfjQ8tlgI07WrhZyywxQUyIBD1F7NEjAjIeSvBv7GK0QEHGwKwgPAijbnFbap22+Ao AxB6wwn4LBPaH3rvJ1+vMdgMqHdoGzmfC/hycSlZfpsuLf8f1xFmDj6CEomQshCW158l bijzr0LQhtWGQMBXQKBHtgYckxwYL9RFUqf9k5D08ERk7X7k6o2OxY0BHZcSA/yFxrqN BxkA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r9dq7opeWVZG3BtwY0r0XLR76Nuys55wAqLRnBp/jbM=; fh=hrttvYDQ/RHeq9ZPl6fx8GLJN/+EeLQ90pmG86Kf6FU=; b=ftGMAXirh4IgbK9OyA1/zbQgsToTCa0a2J7E6f2DGwfOL7jqjAwtKcqb8XcPvez3vf hNl5KArh+a8qNeDv3QWsFP/OHmnZ16gjmf7Ml49kSmJO2HhberJHWK3oJRgTy31PI8Wl 4B+BZvb5O5uEshrDenBBzMWsKrwsAr/YQUnWBJlv7qSs4M9VYOnmcwet5XKDKVq0QN24 NWjrdswzTLX82wPpZVDSHJNU8V3IO+qNfpdGi6nBDgy5RziBW5HtRCF/O3qW0TLKWPjT OvCNDg6G64oVRl+pUU6qpSkmfLUqHwCRNPkwXR230Ej0jsVl+vlFnYz0THvtfgjMN/yk C4kg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gfI7ZNmZ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bf6ff0c8d5si113911816d6.437.2024.08.19.15.54.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2024 15:54:29 -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=gfI7ZNmZ; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgBEz-00022x-EN; Mon, 19 Aug 2024 18:52:47 -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 1sgBEF-0000em-FD for qemu-devel@nongnu.org; Mon, 19 Aug 2024 18:52:01 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sgBED-0000im-RW for qemu-devel@nongnu.org; Mon, 19 Aug 2024 18:51:59 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-429e29933aaso36681315e9.0 for ; Mon, 19 Aug 2024 15:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724107916; x=1724712716; darn=nongnu.org; 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=r9dq7opeWVZG3BtwY0r0XLR76Nuys55wAqLRnBp/jbM=; b=gfI7ZNmZYRuHprksljSI+Wz5RAIY1tuAU4cLs0RdH79qsOHfdW0ha3ar7div2HX8G1 ZQcjFxdg/l5eSh2IMz7pjlm7lzI/28BnXUA8E051Bge6cx1wA/t3fy1AIWakvoZt30D0 ni+SzjBsLdZ5VDpneOj57wcz0+4bVQYF8VYcgvcrfzZVKsNBhvMzCwELv3SPTCxIcT3q 43PAVsyJXjfHvYOZ405ZzhLwPoInAPAiVTeaMmvHongxhba9RYxvJ8yuTrTNEwOH8K3b nx1YgNzc7YOrg22Og8/G9MA66nXkmKOBxAcL3uYvYGNw9CKDh5nbcQgB8MEIe3lV/BWg 1I0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724107916; x=1724712716; 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=r9dq7opeWVZG3BtwY0r0XLR76Nuys55wAqLRnBp/jbM=; b=GCj6ogLiAvWncai7HCJRDQ+fkBV1Cbs7e34XXUzDRrpXVaeMWPgF23+ShlPg6B8s9W acYnbgZOrUoXoufXTvziL9snNTzv7cb7C4RS1nwX6mZRHj6Z1PjJH4wlWWcUA4J3txhh EJBnDj5q1Nxyqqo/bpcobOhGvNZ4a4CqLBMLUxj6+VIeNvCD9Xq6pfTrcR7ud2e9f87Z d5tH6w5VA6Y4QCADqwnq25B3YpwPsJuKN9bOUH+OziESalnVVCXlnalxR3t7z5uFQ502 K/pmoMk5VYL7be2TXxpBB1xdnveUcjfRVPsyWNkBc1q1gNe32xMbQItfjLg22jVPIaL/ +tvg== X-Gm-Message-State: AOJu0YyV27fAhQYHfT88KKfrku8Y/3Bxmu2WR7VhtbVUiALSzbRJC/+T Pszklr1a3Dqzw6S2zQKfpWZbChSHfs5wTkS/XUqPrKRPqU0pQ/jZEnlfcgb3tX9a6sIu9J7Gqzh Q4AY= X-Received: by 2002:a05:600c:310f:b0:426:5b21:97fa with SMTP id 5b1f17b1804b1-429ed7e432cmr101753805e9.29.1724107915886; Mon, 19 Aug 2024 15:51:55 -0700 (PDT) Received: from localhost.localdomain (88-178-97-237.subs.proxad.net. [88.178.97.237]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded1813dsm181831585e9.7.2024.08.19.15.51.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 19 Aug 2024 15:51:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 08/20] hw/remote/message.c: Don't directly invoke DeviceClass:reset Date: Tue, 20 Aug 2024 00:51:04 +0200 Message-ID: <20240819225116.17928-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240819225116.17928-1-philmd@linaro.org> References: <20240819225116.17928-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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, T_SCC_BODY_TEXT_LINE=-0.01 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-bounces+patch=linaro.org@nongnu.org From: Peter Maydell Directly invoking the DeviceClass::reset method is a bad idea, because if the device is using three-phase reset then it relies on transitional reset machinery which is likely to disappear at some point. Reset the device in the standard way, by calling device_cold_reset(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240813165250.2717650-7-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/remote/message.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/remote/message.c b/hw/remote/message.c index 50f6bf2d49..38ae6c75b4 100644 --- a/hw/remote/message.c +++ b/hw/remote/message.c @@ -215,13 +215,10 @@ fail: static void process_device_reset_msg(QIOChannel *ioc, PCIDevice *dev, Error **errp) { - DeviceClass *dc = DEVICE_GET_CLASS(dev); DeviceState *s = DEVICE(dev); MPQemuMsg ret = { 0 }; - if (dc->reset) { - dc->reset(s); - } + device_cold_reset(s); ret.cmd = MPQEMU_CMD_RET;