diff options
author | David Bauer <mail@david-bauer.net> | 2020-03-13 01:07:39 +0100 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2020-03-13 20:43:57 +0100 |
commit | 32726846c85985fbc320d123a7b26b32124cd47a (patch) | |
tree | 6c374c2f4825162ca58c65b2b1beba013ab2412b /target/linux/ath79/patches-5.4/200-ag71xx-Handle-allocation-errors-in-ag71xx_rings_init.patch | |
parent | 0933d1363b262017a815a538a0017f301f34883b (diff) | |
download | upstream-32726846c85985fbc320d123a7b26b32124cd47a.tar.gz upstream-32726846c85985fbc320d123a7b26b32124cd47a.tar.bz2 upstream-32726846c85985fbc320d123a7b26b32124cd47a.zip |
ath79: use downstream ag71xx for Kernel 5.4
The ag71xx driver from Linux 5.4 currently has various shortcomings
when used with OpenWrt compared to our downstream version.
For example, the upstream driver does not support modifying the ethernet
clock and configuring RGMII delays on the MAC side.
While we should certainly switch to the upstream driver, the amount of
necessary patches would make it cumbersome to work with. It's also
highly likely we won't be able to finish patching the upstream driver in
time for a Linux 5.4 release.
Tested on Siemens WS-AP3610.
CC: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/ath79/patches-5.4/200-ag71xx-Handle-allocation-errors-in-ag71xx_rings_init.patch')
-rw-r--r-- | target/linux/ath79/patches-5.4/200-ag71xx-Handle-allocation-errors-in-ag71xx_rings_init.patch | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/target/linux/ath79/patches-5.4/200-ag71xx-Handle-allocation-errors-in-ag71xx_rings_init.patch b/target/linux/ath79/patches-5.4/200-ag71xx-Handle-allocation-errors-in-ag71xx_rings_init.patch deleted file mode 100644 index 6631cb8e17..0000000000 --- a/target/linux/ath79/patches-5.4/200-ag71xx-Handle-allocation-errors-in-ag71xx_rings_init.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 2cee757eaf5cc6175bc0ac7b0b808794124ec40a Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens <hauke@hauke-m.de> -Date: Mon, 17 Feb 2020 23:40:14 +0100 -Subject: [PATCH 1/3] ag71xx: Handle allocation errors in ag71xx_rings_init() - -Free the allocated resources in ag71xx_rings_init() in case -ag71xx_ring_rx_init() returns an error. - -This is only a potential problem, I did not ran into this one. - -Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> -Fixes: d51b6ce441d3 ("net: ethernet: add ag71xx driver") ---- - drivers/net/ethernet/atheros/ag71xx.c | 22 ++++++++++++++++++---- - 1 file changed, 18 insertions(+), 4 deletions(-) - ---- a/drivers/net/ethernet/atheros/ag71xx.c -+++ b/drivers/net/ethernet/atheros/ag71xx.c -@@ -1133,6 +1133,7 @@ static int ag71xx_rings_init(struct ag71 - struct ag71xx_ring *tx = &ag->tx_ring; - struct ag71xx_ring *rx = &ag->rx_ring; - int ring_size, tx_size; -+ int ret; - - ring_size = BIT(tx->order) + BIT(rx->order); - tx_size = BIT(tx->order); -@@ -1145,9 +1146,8 @@ static int ag71xx_rings_init(struct ag71 - ring_size * AG71XX_DESC_SIZE, - &tx->descs_dma, GFP_KERNEL); - if (!tx->descs_cpu) { -- kfree(tx->buf); -- tx->buf = NULL; -- return -ENOMEM; -+ ret = -ENOMEM; -+ goto err_free_buf; - } - - rx->buf = &tx->buf[tx_size]; -@@ -1155,7 +1155,21 @@ static int ag71xx_rings_init(struct ag71 - rx->descs_dma = tx->descs_dma + tx_size * AG71XX_DESC_SIZE; - - ag71xx_ring_tx_init(ag); -- return ag71xx_ring_rx_init(ag); -+ ret = ag71xx_ring_rx_init(ag); -+ if (ret) -+ goto err_free_dma; -+ -+ return 0; -+ -+err_free_dma: -+ dma_free_coherent(&ag->pdev->dev, ring_size * AG71XX_DESC_SIZE, -+ tx->descs_cpu, tx->descs_dma); -+ rx->buf = NULL; -+err_free_buf: -+ kfree(tx->buf); -+ tx->buf = NULL; -+ -+ return ret; - } - - static void ag71xx_rings_free(struct ag71xx *ag) |