Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#1757 - ag71xx crash on ath79 dir-825b1 with eth1 (ag71xx): transmit queue 0 timed out #6769

Closed
openwrt-bot opened this issue Aug 9, 2018 · 5 comments
Labels

Comments

@openwrt-bot
Copy link

Pilot6:

I am building ath79 image for DIR-825b1

The dts file

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

#include "ar7100.dtsi"

/ {
compatible = "dlink,dir-825-b1", "qca,ar7161";
model = "D-Link DIR825B1";

aliases {
	led-status = &orange_power;
};

chosen {
	bootargs = "console=ttyS0,115200";
};

extosc: ref {
	compatible = "fixed-clock";
	#clock-cells = <0>;
	clock-output-names = "ref";
	clock-frequency = <40000000>;
};

leds {
	compatible = "gpio-leds";
	blue_usb {
		label = "d-link:blue:usb";
		gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
		default-state = "off";
		trigger-sources = <&usb_ochi_port>, <&usb_echi_port>;
		linux,default-trigger = "usbport";
	};

	orange_power: orange_power {
		label = "d-link:orange:power";
		gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
	};

	blue_power {
		label = "d-link:blue:power";
		gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
		default-state = "off";
	};

	blue_wps {
		label = "d-link:blue:wps";
		gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
		default-state = "off";
	};

	orange_planet {
		label = "d-link:orange:planet";
		gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
		default-state = "off";
	};

	blue_planet {
		label = "d-link:blue:planet";
		gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
		default-state = "off";
	};
};

ath9k-leds {
	compatible = "gpio-leds";

	wlan2g {
		label = "d-link:blue:wlan2g";
		gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>;
		default-state = "off";
		linux,default-trigger = "phy0tpt";
	};

	wlan5g {
		label = "d-link:blue:wlan5g";
		gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>;
		default-state = "off";
		linux,default-trigger = "phy1tpt";
	};

};

keys {
	compatible = "gpio-keys-polled";
	poll-interval = <20>;

	reset {
		label = "reset";
		linux,code = <KEY_RESTART>;
		gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
		debounce-interval = <60>;
	};

	wps {
		label = "wps";
		linux,code = <KEY_WPS_BUTTON>;
		gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
		debounce-interval = <60>;
	};
};

rtl8366s {
	compatible = "realtek,rtl8366s";
	gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
	gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;

	mdio-bus {
		status = "okay";

		phy-mask = <0x10>;

		phy4: ethernet-phy@4 {
			reg = <4>;
			phy-mode = "rgmii";
		};
	};

};

};

&usb1 {
status = "okay";

usb_ochi_port: port@1 {
	reg = <1>;
	#trigger-source-cells = <0>;
};

};

&usb2 {
status = "okay";

usb_echi_port: port@1 {
	reg = <1>;
	#trigger-source-cells = <0>;
};

};

&usb_phy {
status = "okay";
};

&pcie0 {
status = "okay";

ath9k0: wifi@0,11 {
	compatible = "pci168c,0029";
	reg = <0x8800 0 0 0 0>;
	qca,no-eeprom;
	#gpio-cells = <2>;
	gpio-controller;
};

ath9k1: wifi@0,12 {
	compatible = "pci168c,0029";
	reg = <0x9000 0 0 0 0>;
	qca,no-eeprom;
	#gpio-cells = <2>;
	gpio-controller;
};

};

&uart {
status = "okay";
};

&pll {
clocks = <&extosc>;
};

&spi {
status = "okay";
num-cs = <1>;

flash@0 {
	compatible = "jedec,spi-nor";
	reg = <0>;
	spi-max-frequency = <25000000>;

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "u-boot";
			reg = <0x000000 0x040000>;
			read-only;
		};

		partition@40000 {
			label = "config";
			reg = <0x040000 0x010000>;
			read-only;
		};

		partition@50000 {
			label = "firmware";
			reg = <0x050000 0x610000>;
		};

		caldata: partition@60000 {
			label = "caldata";
			reg = <0x660000 0x010000>;
			read-only;
		};

		partition@670000 {
			label = "unknown";
			reg = <0x670000 0x190000>;
			read-only;
		};
	};
};

};

&eth0 {
status = "okay";
pll-data = <0x11110000 0x00001099 0x00991099>;

fixed-link {
	speed = <1000>;
	full-duplex;
};

};

&eth1 {
status = "okay";
pll-data = <0x11110000 0x00001099 0x00991099>;

phy-handle = <&phy4>;

};

eth1 is connected to rtl8366s phy.

eth1 detects the link and its speed (100Mbit in my case), but fails to transmit.

Tue Aug 7 08:12:14 2018 daemon.info dnsmasq-dhcp[1579]: read /etc/ethers - 0 addresses
Tue Aug 7 08:12:17 2018 daemon.notice netifd: wan (1530): udhcpc: sending discover
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.153052] ------------[ cut here ]------------
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.157706] WARNING: CPU: 0 PID: 1243 at net/sched/sch_generic.c:320 dev_watchdog+0x164/0x274
Tue Aug 7 08:12:25 2018 kern.info kernel: [ 43.166227] NETDEV WATCHDOG: eth1 (ag71xx): transmit queue 0 timed out
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.172733] Modules linked in: ath9k ath9k_common pppoe ppp_async option ath9k_hw ath usb_wwan pppox ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE huawei_cdc_ncm cfg80211 cdc_ncm xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD usbserial usbnet slhc owl_loader nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables crc_ccitt compat cdc_wdm ledtrig_usbport ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables sit tunnel4 ip_tunnel ohci_platform ohci_hcd
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.243509] ehci_platform ehci_hcd gpio_button_hotplug usbcore nls_base usb_common mii
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.251509] CPU: 0 PID: 1243 Comm: dropbearkey Not tainted 4.14.60 #0
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.257937] Stack : 00000000 00000000 80637522 00000039 839c0854 804e78e7 804907c4 000004db
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.266291] 80633670 00000140 804f2cf4 804f2cb4 804f2ca0 00000001 83809db8 f31eff22
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.274647] 00000000 00000000 80630000 00004a40 00000000 00000000 00000007 00000000
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.282993] 000000ef 47176a4e 000000ee 00000000 80000000 00000000 804b77cc 8030e00c
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.291350] 00000009 00000140 804f2cf4 804f2cb4 00000000 8025d8b4 00000000 80630000
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.299706] ...
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.302148] Call Trace:
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.304613] [<8006a90c>] show_stack+0x58/0x100
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.309060] [<80080900>] __warn+0xe4/0x118
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.313163] [<80080964>] warn_slowpath_fmt+0x30/0x3c
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.318124] [<8030e00c>] dev_watchdog+0x164/0x274
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.322827] [<800b99e0>] call_timer_fn.isra.4+0x24/0x84
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.328060] [<800b9bb0>] run_timer_softirq+0x170/0x1e8
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.333210] [<803fd088>] __do_softirq+0xe8/0x2bc
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.337830] [<8020da10>] plat_irq_dispatch+0xc0/0x120
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.342868] [<800658f8>] handle_int+0x138/0x144
Tue Aug 7 08:12:25 2018 kern.warn kernel: [ 43.347398] ---[ end trace cf9dce7cdf8ae6a7 ]---
Tue Aug 7 08:12:25 2018 kern.info kernel: [ 43.351998] eth1: tx timeout
Tue Aug 7 08:12:32 2018 kern.warn kernel: [ 50.795064] done.
Tue Aug 7 08:12:32 2018 kern.notice kernel: [ 50.797029] jffs2: notice: (1406) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
Tue Aug 7 08:12:33 2018 kern.warn kernel: [ 51.339775] overlayfs: upper fs does not support tmpfile.
Tue Aug 7 08:12:33 2018 daemon.info mount_root: performing overlay whiteout
Tue Aug 7 08:12:33 2018 daemon.info mount_root: syncronizing overlay
Tue Aug 7 08:12:33 2018 daemon.err mount_root: failed to sync jffs2 overlay
Tue Aug 7 08:12:35 2018 daemon.info procd: - init complete -
Tue Aug 7 08:12:38 2018 authpriv.info dropbear[1724]: Not backgrounding
Tue Aug 7 08:12:48 2018 authpriv.info dropbear[1731]: Child connection from 192.168.1.2:35996
Tue Aug 7 08:12:48 2018 authpriv.info dropbear[1731]: Exit before auth: Exited normally
Tue Aug 7 08:12:56 2018 kern.info kernel: [ 74.113046] eth1: tx timeout

@openwrt-bot
Copy link
Author

Pilot6:

It looks like the OF code of rtl8366_smi.c sets up reset in a wrong way.
The switch gets an extra reset for some reason. I'll try to debug it.

#ifdef CONFIG_OF
static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active)
{
if (active)
reset_control_assert(smi->reset);
else
reset_control_deassert(smi->reset);
}

int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
{
int sck = of_get_named_gpio(pdev->dev.of_node, "gpio-sck", 0);
int sda = of_get_named_gpio(pdev->dev.of_node, "gpio-sda", 0);
struct device_node *np = pdev->dev.of_node;
struct device_node *mdio_node;

mdio_node = of_parse_phandle(np, "mii-bus", 0);
if (!mdio_node) {
	dev_err(&pdev->dev, "cannot find mdio node phandle");
	goto try_gpio;
}

smi->ext_mbus = of_mdio_find_bus(mdio_node);
if (!smi->ext_mbus) {
	dev_err(&pdev->dev,
		"cannot find mdio bus from bus handle");
	goto try_gpio;
}

return 0;

try_gpio:
if (!gpio_is_valid(sck) || !gpio_is_valid(sda)) {
dev_err(&pdev->dev, "gpios missing in devictree\n");
return -EINVAL;
}

smi->gpio_sda = sda;
smi->gpio_sck = sck;
smi->reset = devm_reset_control_get(&pdev->dev, "switch");
if (!IS_ERR(smi->reset))
	smi->hw_reset = rtl8366_smi_reset;

return 0;

}
#else

@openwrt-bot
Copy link
Author

Pilot6:

It looks like pll-data is not set. I don't see it in the log.

And eth1 crashes only on 100Mbit link and doesn't on 1000.

@openwrt-bot
Copy link
Author

Pilot6:

On ar71xx I see

ar71xx: pll_reg 0xb8050014: 0x1099

And nothing on ath79. It is weird, because I can't find the reason.

@openwrt-bot
Copy link
Author

mkresin:

Dmitry, isn't this fixed as well?

@openwrt-bot
Copy link
Author

Pilot6:

yes, it is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant