forked from Minki/linux
f_phonet: lock-less MTU change
With the current driver, the MTU is purely indicative, so there is no need to synchronize with the receive path. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
aa11d958d1
commit
5da63cc4b2
@ -261,20 +261,10 @@ out:
|
|||||||
|
|
||||||
static int pn_net_mtu(struct net_device *dev, int new_mtu)
|
static int pn_net_mtu(struct net_device *dev, int new_mtu)
|
||||||
{
|
{
|
||||||
struct phonet_port *port = netdev_priv(dev);
|
|
||||||
unsigned long flags;
|
|
||||||
int err = -EBUSY;
|
|
||||||
|
|
||||||
if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU))
|
if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
dev->mtu = new_mtu;
|
||||||
spin_lock_irqsave(&port->lock, flags);
|
return 0;
|
||||||
if (!netif_carrier_ok(dev)) {
|
|
||||||
dev->mtu = new_mtu;
|
|
||||||
err = 0;
|
|
||||||
}
|
|
||||||
spin_unlock_irqrestore(&port->lock, flags);
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct net_device_ops pn_netdev_ops = {
|
static const struct net_device_ops pn_netdev_ops = {
|
||||||
|
Loading…
Reference in New Issue
Block a user