Commit Graph

5 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
John Crispin 9da2b56760 ipq40xx: fix ethernet vlan double tagging
As the the SoC uses implicit vlan tagging for dual MAC support, the
offload feature breaks when using double tagging.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Sven Eckelmann 6785695056 ipq40xx: essedma: Disable TCP segmentation offload for IPv6
It was noticed that the the whole MAC can hang when transferring data from
one ar40xx port (WAN ports) to the CPU and from the CPU back to another
ar40xx port (LAN ports). The CPU was doing only NATing in that process.

Usually, the problem first starts with a simple data corruption:

  $ wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.4.0-amd64-netinst.iso -O /dev/null
  ...
  Connecting to saimei.ftp.acc.umu.se (saimei.ftp.acc.umu.se)|2001:6b0:19::138|:443... connected.
  ...
  Read  error at byte 48807936/352321536 (Decryption has failed.). Retrying.

But after a short while, the whole MAC will stop to react. No traffic can
be transported anymore from the CPU port from/to the AR40xx PHY/switch and
the MAC has to be resetted.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: John Crispin <john@phrozen.org>
4 years ago
Robert Marko 72c3997003 ipq40xx: 5.4: fix ethernet driver
In 5.4 kernel old u32 array way of setting network features was dropped and linkmode is now the only way.
So lets migrate the EDMA driver to support linkmode.
Also, old get/set settings API for ethtool is also dropped so lets convert to new ksettings API while at it as it demands linkmode.

Now, gigabit works properly as well as ethtool.
Previously you would get this in ethtool:
root@OpenWrt:/# ethtool eth1
Settings for eth1:
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes

Now, features are properly advertised:
root@OpenWrt:/# ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 4
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
4 years ago
Petr Štetiar f521ef5ff3 ipq40xx: 5.4: fix of_get_mac_address obsolete usage OOPs
of_get_mac_address returns valid pointer or ERR_PTR since 5.2 via commit
d01f449c008a ("of_net: add NVMEM support to of_get_mac_address") so the
patch fixes following OOPs on nbg6617:

 Unable to handle kernel paging request at virtual address ffffffed
 CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.4.24 #0
 PC is at edma_axi_probe+0x444/0x1114
 LR is at bus_find_device+0x88/0x9c

Where the PC can be resolved to:

 >>> l *edma_axi_probe+0x444
 0xc067be5c is in edma_axi_probe (./include/linux/string.h:378).

 >>> l *edma_axi_probe+0x43f
 0xc067be57 is in edma_axi_probe (drivers/net/ethernet/qualcomm/essedma/edma_axi.c:936)

Which leads to the following code fragment:

 935  mac_addr = of_get_mac_address(pnp);
 936  if (mac_addr)
 937      memcpy(edma_netdev[idx_mac]->dev_addr, mac_addr, ETH_ALEN);

Where using mac_addr=0xffffffed (-ENODEV) as source address in memcpy()
is causing the OOPs.

Acked-by: John Crispin <john@phrozen.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
John Crispin 272e0a702a ipq40xx: add v5.4 support
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago