[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1283265682.2244.0.camel@achroite.uk.solarflarecom.com>
Date: Tue, 31 Aug 2010 15:41:22 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Liang Li <liang.li@...driver.com>
Cc: leoli@...escale.com, davem@...emloft.net, avorontsov@...mvista.com,
netdev@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] ucc_geth: fix ethtool set ring param bug
On Mon, 2010-08-30 at 22:47 +0800, Liang Li wrote:
> It's common sense that when we should do change to driver ring
> desc/buffer etc only after 'stop/shutdown' the device. When we
> do change while devices/driver is running, kernel oops occur:
[...]
> diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
> index 6f92e48..1b37aaa 100644
> --- a/drivers/net/ucc_geth_ethtool.c
> +++ b/drivers/net/ucc_geth_ethtool.c
> @@ -255,13 +255,18 @@ uec_set_ringparam(struct net_device *netdev,
> return -EINVAL;
> }
>
> - ug_info->bdRingLenRx[queue] = ring->rx_pending;
> - ug_info->bdRingLenTx[queue] = ring->tx_pending;
> -
> if (netif_running(netdev)) {
> - /* FIXME: restart automatically */
> - printk(KERN_INFO
> - "Please re-open the interface.\n");
> + printk(KERN_INFO "Stopping interface %s.\n", netdev->name);
> + ucc_geth_close(netdev);
> +
> + ug_info->bdRingLenRx[queue] = ring->rx_pending;
> + ug_info->bdRingLenTx[queue] = ring->tx_pending;
> +
> + printk(KERN_INFO "Reactivating interface %s.\n", netdev->name);
> + ucc_geth_open(netdev);
What if ucc_geth_open() fails?
Ben.
> + } else {
> + ug_info->bdRingLenRx[queue] = ring->rx_pending;
> + ug_info->bdRingLenTx[queue] = ring->tx_pending;
> }
>
> return ret;
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists