linux_dsm_epyc7002/drivers/net/ethernet
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
..
3com 3c59x: Remove unused pointer in vortex_eisa_cleanup() 2014-02-09 19:06:14 -08:00
8390 net/apne: Remove unused variable ei_local 2014-01-26 22:40:43 -08:00
adaptec
adi
aeroflex drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
allwinner net: ethernet: sunxi: Add new compatibles 2014-02-06 19:46:54 -08:00
alteon drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
apple
arc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-06 17:37:45 -05:00
atheros ATHEROS-ATL1E: Convert iounmap to pci_iounmap 2014-03-18 16:12:56 -04:00
broadcom cnic: Update version to 2.5.20 and copyright year. 2014-03-18 16:02:16 -04:00
brocade bna: Replace large udelay() with mdelay() 2014-03-10 15:56:59 -04:00
cadence net: macb: DMA-unmap full rx-buffer 2014-03-05 20:40:25 -05:00
calxeda drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
chelsio net/cxgb4: use remove handler as shutdown handler 2014-02-25 18:35:13 -05:00
cirrus drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cisco net: enic: slight optimization of addr compare 2013-12-31 16:48:31 -05:00
davicom dm9000: fix a lot of checkpatch issues 2014-01-16 16:22:53 -08:00
dec drivers/net: tulip_remove_one needs to call pci_disable_device() 2014-02-17 00:19:24 -05:00
dlink drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
emulex be2net: isolate TX workarounds not applicable to Skyhawk-R 2014-03-03 15:48:11 -05:00
faraday net: ftgmac100: use kfree_skb() where appropriate 2014-01-17 18:54:13 -08:00
freescale eth: fec: Fix lost promiscuous mode after reconnecting cable 2014-03-13 15:46:20 -04:00
fujitsu drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
hp
i825xx drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
ibm ibmveth: Fix endian issues with MAC addresses 2014-03-06 16:26:41 -05:00
icplus drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
intel netdevice: add queue selection fallback handler for ndo_select_queue 2014-02-17 00:36:34 -05:00
marvell net: ethernet: update dependency and help text of mvneta 2014-02-18 18:09:02 -05:00
mellanox net/mlx4_en: Deregister multicast vxlan steering rules when going down 2014-03-13 13:35:40 -04:00
micrel net: micrel : ks8851-ml: add vdd-supply support 2014-03-24 00:36:47 -04:00
microchip
moxa drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
myricom
natsemi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
neterion net: vxge: Remove unused device pointer 2014-02-09 19:11:07 -08:00
nuvoton
nvidia drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
nxp drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
octeon
oki-semi
packetengines net: packetengines: slight optimization of addr 2013-12-31 16:48:32 -05:00
pasemi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
qlogic qlcnic: dcb: a couple off by one bugs 2014-03-03 15:38:12 -05:00
rdc r6040: use ETH_ZLEN instead of MISR for SKB length checking 2014-01-16 16:22:54 -08:00
realtek r8169: fix the incorrect tx descriptor version 2014-03-12 00:11:43 -04:00
renesas sh_eth: Add support for r7s72100 2014-01-17 18:13:58 -08:00
seeq drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
sfc sfc: check for NULL efx->ptp_data in efx_ptp_event 2014-02-26 15:22:02 -05:00
sgi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
silan
sis
smsc drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
stmicro stmmac: dwmac-sti: fix broken STiD127 compatibility 2014-03-11 16:14:31 -04:00
sun drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
tehuti net: Spelling s/transmition/transmission/ 2014-01-14 17:11:26 -08:00
ti net: davinci_emac: Fix rollback of emac_dev_open() 2014-03-24 15:32:03 -04:00
tile netdevice: add queue selection fallback handler for ndo_select_queue 2014-02-17 00:36:34 -05:00
toshiba drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
tundra drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
via via-rhine: Disable device in error path 2014-03-19 16:08:29 -04:00
wiznet
xilinx net: axienet: Fix compilation warnings 2014-02-13 18:07:40 -05:00
xircom
xscale
dnet.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
dnet.h
ethoc.c net: ethoc: set up MII management bus clock 2014-02-04 20:19:51 -08:00
fealnx.c
jme.c
jme.h
Kconfig
korina.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
lantiq_etop.c netdevice: add queue selection fallback handler for ndo_select_queue 2014-02-17 00:36:34 -05:00
Makefile
netx-eth.c
s6gmac.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00