USB: u_ether: Prevent unclocked access when running rndis interface down

When in rndis composition, if device is disabled in device manager,
usb enters low power mode. Then if rndis interface is put down,
ep_disable is called leading to crash due to unclocked access as
clocks are turned off when usb enters lpm. Fix this by waking up
the controller, then performing ep_disable operation and then
putting controller back to lpm.

Change-Id: I45d29ef2e2678a3d6383d3fdd5550c8b8e156875
Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
This commit is contained in:
Rohith Kollalsi 2021-09-06 20:27:24 +05:30 • committed by Gerrit - the friendly Code Review server
commit da0ce57aed

View file

@ -650,6 +650,8 @@ static int eth_stop(struct net_device *net)
dev->net->stats.rx_errors, dev->net->stats.tx_errors
);
usb_gadget_autopm_get(dev->gadget);
/* ensure there are no more active requests */
spin_lock_irqsave(&dev->lock, flags);
if (dev->port_usb) {
@ -682,6 +684,7 @@ static int eth_stop(struct net_device *net)
}
}
spin_unlock_irqrestore(&dev->lock, flags);
usb_gadget_autopm_put_async(dev->gadget);
return 0;
}