From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64C78882B for ; Fri, 10 Mar 2023 15:12:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CEB0C433EF; Fri, 10 Mar 2023 15:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678461128; bh=eOs9ZlG6rA7Ow/z/n2/GUd5uFdqDN94f2HPZOl0GIrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SB2yztFSYQcmZKLgz5pzkFeIC7fKcu/crf9LMq1cuz9KCVkuJ3tzzP8ASQSy4bt5I 2ukSk3jfqjUSO/9O2vhxT6bftIJXikW/7eAkeyXnMV3RYyzc6SR8ZWHy0Qo+ELQnac DPsg4hUBywMWxF+26LwghtcZUp49V7m7AC45QuBQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Benjamin Berg , Richard Weinberger , Sasha Levin Subject: [PATCH 5.15 035/136] um: virtio_uml: move device breaking into workqueue Date: Fri, 10 Mar 2023 14:42:37 +0100 Message-Id: <20230310133708.110386051@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133706.811226272@linuxfoundation.org> References: <20230310133706.811226272@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Benjamin Berg [ Upstream commit abdeb4fa5e1b5b4918034f02236fd886f40c20c1 ] We should not be calling virtio_break_device from an IRQ context. Move breaking the device into the workqueue so that it is done from a reasonable context. Fixes: af9fb41ed315 ("um: virtio_uml: Fix broken device handling in time-travel") Signed-off-by: Benjamin Berg Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/um/drivers/virtio_uml.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index c16ae3676ee08..204e9dfbff1a0 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -170,7 +170,6 @@ static void vhost_user_check_reset(struct virtio_uml_device *vu_dev, vu_dev->registered = 0; - virtio_break_device(&vu_dev->vdev); schedule_work(&pdata->conn_broken_wk); } @@ -1134,6 +1133,15 @@ void virtio_uml_set_no_vq_suspend(struct virtio_device *vdev, static void vu_of_conn_broken(struct work_struct *wk) { + struct virtio_uml_platform_data *pdata; + struct virtio_uml_device *vu_dev; + + pdata = container_of(wk, struct virtio_uml_platform_data, conn_broken_wk); + + vu_dev = platform_get_drvdata(pdata->pdev); + + virtio_break_device(&vu_dev->vdev); + /* * We can't remove the device from the devicetree so the only thing we * can do is warn. @@ -1264,8 +1272,14 @@ static int vu_unregister_cmdline_device(struct device *dev, void *data) static void vu_conn_broken(struct work_struct *wk) { struct virtio_uml_platform_data *pdata; + struct virtio_uml_device *vu_dev; pdata = container_of(wk, struct virtio_uml_platform_data, conn_broken_wk); + + vu_dev = platform_get_drvdata(pdata->pdev); + + virtio_break_device(&vu_dev->vdev); + vu_unregister_cmdline_device(&pdata->pdev->dev, NULL); } -- 2.39.2