lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1490383355-23176-18-git-send-email-jliang@xilinx.com>
Date:   Fri, 24 Mar 2017 12:22:33 -0700
From:   Wendy Liang <wendy.liang@...inx.com>
To:     <bjorn.andersson@...aro.org>
CC:     <linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        "Wendy Liang" <wendy.liang@...inx.com>,
        Wendy Liang <jliang@...inx.com>,
        Michal Simek <michal.simek@...inx.com>
Subject: [RFC LINUX PATCH 17/19] remoteproc: virtio: kick in reset virtio

From: Wendy Liang <wendy.liang@...inx.com>

Kick the remote in virtio reset.
In order to be backward compatible, only set the vdev
status to NEEDS_RESET and kick the remote if the remote is
RUNNING_INDEPENDENT, that is only if the remote is already
running.

Signed-off-by: Wendy Liang <jliang@...inx.com>
Signed-off-by: Michal Simek <michal.simek@...inx.com>
---
 drivers/remoteproc/remoteproc_virtio.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index d43e15b..bf3be6f1 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -231,8 +231,19 @@ static void rproc_virtio_reset(struct virtio_device *vdev)
 
 	rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
 
-	rsc->status = 0;
 	dev_dbg(&vdev->dev, "reset !\n");
+	if (rvdev->rproc->state == RPROC_RUNNING_INDEPENDENT) {
+		rsc->status = VIRTIO_CONFIG_S_NEEDS_RESET;
+		virtio_mb(false);
+		rproc_virtio_notify(rvdev);
+		while (rsc->status) {
+			if (!wait_for_completion_timeout(
+				&rvdev->config_wait_complete, HZ))
+				break;
+		}
+	} else {
+		rsc->status = 0;
+	}
 }
 
 /* provide the vdev features as retrieved from the firmware */
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ