linux-stable/drivers/net
Christian Riesch cd11cf5053 net: davinci_emac: Fix rollback of emac_dev_open()
If an error occurs during the initialization in emac_dev_open() (the
driver's ndo_open function), interrupts, DMA descriptors etc. must be freed.
The current rollback code is buggy in several ways.

  1) Freeing the interrupts. The current code will not free all interrupts
     that were requested by the driver. Furthermore,  the code tries to do a
     platform_get_resource(priv->pdev, IORESOURCE_IRQ, -1) in its last
     iteration.

     This patch fixes these bugs.

  2) Wrong order of err: and rollback: labels. If the setup of the PHY in
     the code fails, the interrupts that have been requested before are
     not freed:

        request irq
                if requesting irqs fails, goto rollback
        setup phy
                if phy setup fails, goto err
        return 0

     rollback:
        free irqs
     err:

     This patch brings the code into the correct order.

  3) The code calls napi_enable() and emac_int_enable(), but does not
     undo both in case of an error.

     This patch adds calls of emac_int_disable() and napi_disable() to the
     rollback code.

  4) RX DMA descriptors are not freed in case of an error: Right before
     requesting the irqs, the function creates DMA descriptors for the
     RX channel. These RX descriptors are never freed when we jump to either
     rollback or err.

     This patch adds code for freeing the DMA descriptors in the case of
     an initialization error. This required a modification of
     cpdma_ctrl_stop() in davinci_cpdma.c: We must be able to call this
     function to free the DMA descriptors while the DMA channels are
     in IDLE state (before cpdma_ctlr_start() was called).

Tested on a custom board with the Texas Instruments AM1808.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 15:32:03 -04:00
..
appletalk
arcnet drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
bonding bonding: set correct vlan id for alb xmit path 2014-03-13 15:45:10 -04:00
caif drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
can can: flexcan: factor out soft reset into seperate funtion 2014-03-03 14:29:51 +01:00
cris
dsa
ethernet net: davinci_emac: Fix rollback of emac_dev_open() 2014-03-24 15:32:03 -04:00
fddi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
hamradio Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-06 17:37:45 -05:00
hippi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
hyperv hyperv: Move state setting for link query 2014-03-05 20:40:25 -05:00
ieee802154 at86rf230: fix lockdep splats 2014-03-13 15:44:24 -04:00
irda irtty-sir.c: Do not set_termios() on irtty_close() 2014-02-17 16:27:51 -05:00
phy net: phy: fix uninitalized ethtool_wolinfo in phy_suspend 2014-03-14 22:38:54 -04:00
plip net: plip: slight optimization of addr compare 2013-12-31 16:48:33 -05:00
ppp ppp: slight optimization of addr compare 2013-12-26 13:31:33 -05:00
slip
team netdevice: add queue selection fallback handler for ndo_select_queue 2014-02-17 00:36:34 -05:00
usb net: cdc_ncm: fix control message ordering 2014-03-18 15:32:32 -04:00
vmxnet3 vmxnet3: fix building without CONFIG_PCI_MSI 2014-03-13 12:56:38 -04:00
wan wan: dlci: Remove unused netdev_priv pointer 2014-02-09 18:40:56 -08:00
wimax
wireless Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem 2014-03-14 14:09:47 -04:00
xen-netback xen-netback: use skb_is_gso in xenvif_start_xmit 2014-03-12 15:36:32 -04:00
dummy.c
eql.c eql: use __dev_get_by_name instead of dev_get_by_name to find interface 2014-01-14 18:50:46 -08:00
ifb.c
Kconfig net: fix macvtap type name in Kconfig 2014-02-13 15:48:31 -05:00
LICENSE.SRC
loopback.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
macvlan.c macvlan: Add support for 'always_on' offload features 2014-03-03 16:43:56 -05:00
macvtap.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
Makefile
mdio.c mdio: unused ethtool functions 2013-12-26 13:29:35 -05:00
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c drivers: net: Include new header file in sbni.c 2013-12-19 18:51:20 -05:00
sungem_phy.c
tun.c tun: remove bogus hardware vlan acceleration flags from vlan_features 2014-02-20 02:15:38 -05:00
veth.c veth: Fix vlan_features so as to be able to use stacked vlan interfaces 2014-02-20 02:15:38 -05:00
virtio_net.c virtio-net: alloc big buffers also when guest can receive UFO 2014-02-24 18:19:52 -05:00
vxlan.c vxlan: fix potential NULL dereference in arp_reduce() 2014-03-18 16:09:34 -04:00
xen-netfront.c xen-netfront: reset skb network header before checksum 2014-02-19 16:52:51 -05:00