From 8fc0add3599f424fbb4a633d09de4fdad9c81bd6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 19 Dec 2022 16:42:55 +0100 Subject: [PATCH] 5.4-stable patches added patches: xen-netback-move-removal-of-hotplug-status-to-the-right-place.patch --- queue-5.4/series | 1 + ...of-hotplug-status-to-the-right-place.patch | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 queue-5.4/xen-netback-move-removal-of-hotplug-status-to-the-right-place.patch diff --git a/queue-5.4/series b/queue-5.4/series index bac565575b6..7b6a40bd2a3 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -10,3 +10,4 @@ usb-serial-f81232-fix-division-by-zero-on-line-speed-change.patch usb-serial-f81534-fix-division-by-zero-on-line-speed-change.patch igb-initialize-mailbox-message-for-vf-reset.patch usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch +xen-netback-move-removal-of-hotplug-status-to-the-right-place.patch diff --git a/queue-5.4/xen-netback-move-removal-of-hotplug-status-to-the-right-place.patch b/queue-5.4/xen-netback-move-removal-of-hotplug-status-to-the-right-place.patch new file mode 100644 index 00000000000..9a0a00b1b55 --- /dev/null +++ b/queue-5.4/xen-netback-move-removal-of-hotplug-status-to-the-right-place.patch @@ -0,0 +1,69 @@ +From ptyadav@amazon.de Mon Dec 19 16:41:51 2022 +From: Pratyush Yadav +Date: Mon, 19 Dec 2022 16:37:10 +0100 +Subject: xen-netback: move removal of "hotplug-status" to the right place +To: +Cc: "Pratyush Yadav" , "Greg Kroah-Hartman" , "Wei Liu" , "Paul Durrant" , "David S. Miller" , "Marek Marczykowski-Górecki" , "Jakub Kicinski" , "Sasha Levin" , "Puranjay Mohan" , "Maximilian Heyne" , "Julien Grall" , xen-devel@lists.xenproject.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org +Message-ID: <20221219153710.23782-1-ptyadav@amazon.de> + +From: Pratyush Yadav + +The removal of "hotplug-status" has moved around a bit. First it was +moved from netback_remove() to hotplug_status_changed() in upstream +commit 1f2565780e9b ("xen-netback: remove 'hotplug-status' once it has +served its purpose"). Then the change was reverted in upstream commit +0f4558ae9187 ("Revert "xen-netback: remove 'hotplug-status' once it has +served its purpose""), but it moved the removal to backend_disconnect(). +Then the upstream commit c55f34b6aec2 ("xen-netback: only remove +'hotplug-status' when the vif is actually destroyed") moved it finally +back to netback_remove(). The thing to note being it is removed +unconditionally this time around. + +The story on v5.4.y adds to this confusion. Commit 60e4e3198ce8 ("Revert +"xen-netback: remove 'hotplug-status' once it has served its purpose"") +is backported to v5.4.y but the original commit that it tries to revert +was never present on 5.4. So the backport incorrectly ends up just +adding another xenbus_rm() of "hotplug-status" in backend_disconnect(). + +Now in v5.4.y it is removed in both backend_disconnect() and +netback_remove(). But it should only be removed in netback_remove(), as +the upstream version does. + +Removing "hotplug-status" in backend_disconnect() causes problems when +the frontend unilaterally disconnects, as explained in +c55f34b6aec2 ("xen-netback: only remove 'hotplug-status' when the vif is +actually destroyed"). + +Remove "hotplug-status" in the same place as it is done on the upstream +version to ensure unilateral re-connection of frontend continues to +work. + +Fixes: 60e4e3198ce8 ("Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"") +Signed-off-by: Pratyush Yadav +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/xen-netback/xenbus.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/xen-netback/xenbus.c ++++ b/drivers/net/xen-netback/xenbus.c +@@ -202,10 +202,10 @@ static int netback_remove(struct xenbus_ + set_backend_state(be, XenbusStateClosed); + + unregister_hotplug_status_watch(be); ++ xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); + if (be->vif) { + kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); + xen_unregister_watchers(be->vif); +- xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); + xenvif_free(be->vif); + be->vif = NULL; + } +@@ -435,7 +435,6 @@ static void backend_disconnect(struct ba + unsigned int queue_index; + + xen_unregister_watchers(vif); +- xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status"); + #ifdef CONFIG_DEBUG_FS + xenvif_debugfs_delif(vif); + #endif /* CONFIG_DEBUG_FS */ -- 2.47.3