49 lines
1.6 KiB
Diff
49 lines
1.6 KiB
Diff
|
|
From ea0169b5de433426e863f162f7a299fc29b9ff8d Mon Sep 17 00:00:00 2001
|
||
|
|
From: Peter Maydell <peter.maydell@linaro.org>
|
||
|
|
Date: Tue, 13 Aug 2024 17:52:46 +0100
|
||
|
|
Subject: [PATCH] hw/remote/message.c: Don't directly invoke DeviceClass:reset
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
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 <peter.maydell@linaro.org>
|
||
|
|
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||
|
|
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
||
|
|
Message-ID: <20240813165250.2717650-7-peter.maydell@linaro.org>
|
||
|
|
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org
|
||
|
|
(cherry picked from commit 7d3a421feab29c03601813c8a0f98d5b2fd4420a)
|
||
|
|
Signed-off-by: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
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 11d729845c..83b91c8762 100644
|
||
|
|
--- a/hw/remote/message.c
|
||
|
|
+++ b/hw/remote/message.c
|
||
|
|
@@ -216,13 +216,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;
|
||
|
|
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|