[OpenWrt-Devel] lantiq v3.18

Daniel Gimpelevich daniel at gimpelevich.san-francisco.ca.us
Tue Feb 10 22:33:42 EST 2015


John Crispin <john at phrozen.org> writes:
> 
> 
> On 10/02/2015 19:35, Joerg Hollmann wrote:
> > Hello Daniel,
> > 
> > could it be, that the definition of the kernel partition in the dts
> > file of your device ist too small?
> 
> i think the problem is that spi-gpio is either not loaded or loaded
> too late. i wont have time to look at it till friday though.
> 
> > I have seen similar error messages on the builds for the VG3503J.
> 
> there is a kernel part defined in the dts ? the mtdsplit should handle
> it for your. i'll look at that aswell, only tested a initramfs on the
> VG3503J

Booting an initramfs of 3.18 succeeds but still does not detect the
SPI flash. It also uses a wrong macaddr, no doubt due to the following
wrong logic in 0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch

--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -161,7 +161,7 @@ struct ltq_etop_priv {
        int tx_irq;
        int rx_irq;
 
-       const void *mac;
+       void *mac;
        int mii_mode;
 
        spinlock_t lock;
@@ -840,7 +840,11 @@ ltq_etop_init(struct net_device *dev)
        if (err)
                goto err_hw;
 
-       memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr));
+       if (priv->mac)
+               memcpy(&mac, priv->mac, sizeof(struct sockaddr));
+       else
+               memcpy(&mac, ltq_get_eth_mac(), sizeof(struct sockaddr))
+
        if (!is_valid_ether_addr(mac.sa_data)) {
                pr_warn("etop: invalid MAC, using random\n");
                eth_random_addr(mac.sa_data);

This stuffs the macaddr into the wrong field of the sockaddr and reads
beyond the end of the macaddr. The corresponding patch to 3.14 was right
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list