diff mbox

[OpenWrt-Devel] ramips: Fix failsafe switch workaround for RT5350 introduced in r42179.

Message ID owrt-patches-20150308-3@vittgam.net
State Changes Requested
Headers show

Commit Message

Vittorio Gambaletta March 8, 2015, 1:44 a.m. UTC
This patch fixes the failsafe switch workaround to avoid soft-bricking routers where the only exposed Ethernet port is not 0 (it is 4 for the HT-TM02 for instance).

This is a follow-up of http://patchwork.ozlabs.org/patch/424017/ (sorry for the delay).

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>

Comments

John Crispin March 10, 2015, 1:18 p.m. UTC | #1
On 08/03/2015 02:44, Vittorio G (VittGam) wrote:
> This patch fixes the failsafe switch workaround to avoid soft-bricking routers where the only exposed Ethernet port is not 0 (it is 4 for the HT-TM02 for instance).
> 
> This is a follow-up of http://patchwork.ozlabs.org/patch/424017/ (sorry for the delay).
> 
> Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
> 
> diff --git a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
> index cae6396..efdc5fd 100644
> --- a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
> +++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
> @@ -20,7 +20,7 @@ ramips_set_preinit_iface() {
>  		# disabled:
>  		# https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg19870.html
>  		swconfig dev rt305x set enable_vlan 1
> -		swconfig dev rt305x vlan 1 set ports "0 6"
> +		swconfig dev rt305x vlan 1 set ports "0 1 2 3 4 5 6"
>  		swconfig dev rt305x port 6 set untag 0
>  		swconfig dev rt305x set apply 1
>  		vconfig add eth0 1
> 

hi

can you send a version that has the pattern shown below please

and "0 1 2 3 4 5 6" is wrong, exclude the wan port from the list please.

	John


board=$(ramips_board_name)

board_config_update
ports="0 6""
case $board in
my_board_name)
	ports="0 1 2 3 4 5 6"
	;;	
esac
swconfig dev rt305x set enable_vlan 1
swconfig dev rt305x vlan 1 set ports "$ports"
swconfig dev rt305x port 6 set untag 0
swconfig dev rt305x set apply 1
vconfig add eth0 1
Vittorio Gambaletta March 10, 2015, 7:16 p.m. UTC | #2
Il 10.03.2015 14:18 John Crispin ha scritto:
> hi
>
> can you send a version that has the pattern shown below please
>
> and "0 1 2 3 4 5 6" is wrong, exclude the wan port from the list please.
>
> 	John
>
>

The problem is that it's not easy to determine what number the LAN or WAN port(s) is/are. On many routers a LAN port can be 0, but on the HT-TM02 there is only one port and it is 4. So the current "0 6" is effectively soft-bricking the HT-TM02 if failsafe is needed and one doesn't have a serial adapter... That's why I proposed to just enable all ports for failsafe.

> board=$(ramips_board_name)
>
> board_config_update
> ports="0 6""
> case $board in
> my_board_name)
> 	ports="0 1 2 3 4 5 6"
> 	;;
> esac
> swconfig dev rt305x set enable_vlan 1
> swconfig dev rt305x vlan 1 set ports "$ports"
> swconfig dev rt305x port 6 set untag 0
> swconfig dev rt305x set apply 1
> vconfig add eth0 1

This needs to be better addressed somehow, without replicating the port layout here for every router that does not have port 0 exposed at all.
John Crispin March 10, 2015, 7:42 p.m. UTC | #3
On 10/03/2015 20:16, Vittorio G (VittGam) wrote:
> Il 10.03.2015 14:18 John Crispin ha scritto:
>> hi
>>
>> can you send a version that has the pattern shown below please
>>
>> and "0 1 2 3 4 5 6" is wrong, exclude the wan port from the list please.
>>
>>     John
>>
>>
> 
> The problem is that it's not easy to determine what number the LAN or
> WAN port(s) is/are. On many routers a LAN port can be 0, but on the
> HT-TM02 there is only one port and it is 4. So the current "0 6" is
> effectively soft-bricking the HT-TM02 if failsafe is needed and one
> doesn't have a serial adapter... That's why I proposed to just enable
> all ports for failsafe.
> 
>> board=$(ramips_board_name)
>>
>> board_config_update
>> ports="0 6""
>> case $board in
>> my_board_name)
>>     ports="0 1 2 3 4 5 6"
>>     ;;
>> esac
>> swconfig dev rt305x set enable_vlan 1
>> swconfig dev rt305x vlan 1 set ports "$ports"
>> swconfig dev rt305x port 6 set untag 0
>> swconfig dev rt305x set apply 1
>> vconfig add eth0 1
> 
> This needs to be better addressed somehow, without replicating the port
> layout here for every router that does not have port 0 exposed at all.

we can hook this up with the board detect code. i'll put it on my todo
list. might take a bit till i find the time
Vittorio Gambaletta March 10, 2015, 8:36 p.m. UTC | #4
Il 10.03.2015 20:42 John Crispin ha scritto:
> we can hook this up with the board detect code. i'll put it on my todo
> list. might take a bit till i find the time

That would be great!

By the way, we should test if recent revisions fix the checksum issue so that we can completely remove this hacky workaround. On my RT5350-based HT-TM02, disabling VLAN and using eth0 works as of r43771, while it didn't work on r42649. (That's why I proposed http://patchwork.ozlabs.org/patch/424017/ at first.) But I don't have hardware based on other affected SoCs (rt3x5x, mt7628) to test.
diff mbox

Patch

diff --git a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
index cae6396..efdc5fd 100644
--- a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
+++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
@@ -20,7 +20,7 @@  ramips_set_preinit_iface() {
 		# disabled:
 		# https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg19870.html
 		swconfig dev rt305x set enable_vlan 1
-		swconfig dev rt305x vlan 1 set ports "0 6"
+		swconfig dev rt305x vlan 1 set ports "0 1 2 3 4 5 6"
 		swconfig dev rt305x port 6 set untag 0
 		swconfig dev rt305x set apply 1
 		vconfig add eth0 1