Skip to contentSkip to conversation

usb: gadget: u_ether: revert netif_device_detach change

PATCH In review Ferry Toth 2 participants 4 messages Jun 20, 2024 – Jun 27, 2024

Subsystems (2)
lore
Share & tools
lore

Ferry Toth

author
#0 lore raw

v3 cover usb: gadget: u_ether: revert netif_device_detach change

As agreed with the author, the netif_device_detach change is going to be reverted by this series, so we will collaborate on a new one in the future that brings no regressions.

v3:
- Send out actual version (Ferry)

v2:
- Add SoB (Greg)

Ferry Toth (2):
Revert "usb: gadget: u_ether: Re-attach netif device to mirror
detachment"
Revert "usb: gadget: u_ether: Replace netif_stop_queue with
netif_device_detach"

 drivers/usb/gadget/function/u_ether.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH v3 1/2 Revert "usb: gadget: u_ether: Re-attach netif device to mirror detachment"

This reverts commit 76c945730cdffb572c7767073cc6515fd3f646b4.

Prerequisite revert for the reverting of the original commit f49449fbc21e.

Fixes 76c945730cdf ("usb: gadget: u_ether: Re-attach netif device to mirror detachment")
Fixes f49449fbc21e ("usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach")
---
 drivers/usb/gadget/function/u_ether.c | 2 --
 1 file changed, 2 deletions(-)
drivers/usb/gadget/function/u_ether.c +0 -2
index 11dd0b9e847f..aa0511c3a62c 100644
@@ -1163,8 +1163,6 @@ struct net_device *gether_connect(struct gether *link)
 		if (netif_running(dev->net))
 			eth_start(dev, GFP_ATOMIC);
 
-		netif_device_attach(dev->net);
-
 	/* on error, disable any endpoints  */
 	} else {
 		(void) usb_ep_disable(link->out_ep);
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH v3 2/2 Revert "usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach"

In reply to Ferry Toth

This reverts commit f49449fbc21e7e9550a5203902d69c8ae7dfd918.

This commit breaks u_ether on some setups (at least Merrifield). The fix "usb: gadget: u_ether: Re-attach netif device to mirror detachment" party restores u-ether. However the netif usb: remains up even usb is switched from device to host mode. This creates problems for user space as the interface remains in the routing table while not realy present and network managers (connman) not detecting a network change.

Various attempts to find the root cause were unsuccesful up to now. Therefore revert until a solution is found.

Fixes f49449fbc21e ("usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach")
---
 drivers/usb/gadget/function/u_ether.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/u_ether.c +1 -1
index aa0511c3a62c..95191083b455 100644
@@ -1200,7 +1200,7 @@ void gether_disconnect(struct gether *link)
 
 	DBG(dev, "%s\n", __func__);
 
-	netif_device_detach(dev->net);
+	netif_stop_queue(dev->net);
 	netif_carrier_off(dev->net);
 
 	/* disable endpoints, forcing (synchronous) completion
Signature · 1 line
2.43.0
#3 lore raw
In reply to Ferry Toth
Quoted 6 lines · Ferry Toth

As agreed with the author, the netif_device_detach change is going to be reverted by this series, so we will collaborate on a new one in the future that brings no regressions.

v3:
- Send out actual version (Ferry)

Much better, thanks, now queued up!

greg k-h