Modify

Opened 9 years ago

Closed 9 years ago

Last modified 22 months ago

#1009 closed defect (fixed)

bogus Reset switch press on WRT54GS V1 @ kamikaze causes stuckness in /etc/preinit

Reported by: anonymous Owned by: mbm
Priority: high Milestone: Barrier Breaker 14.07
Component: packages Version:
Keywords: failsafe reset switch Cc:

Description

When trying kamikaze 5684 with the patch from #983 (I haven't looked at it without),
my WRT54GS falsely detects a reset button press during boot.
I have tried the following patch just to make sure I'm not kidding me:

Index: trunk/package/broadcom-diag/src/diag.c
===================================================================
--- trunk/package/broadcom-diag/src/diag.c      (revision 5684)
+++ trunk/package/broadcom-diag/src/diag.c      (working copy)
@@ -583,6 +583,7 @@
                        scratch += sprintf (scratch, "SEEN=%ld", (jiffies - b->seen)/HZ) + 1;
                        event->envp[i] = 0;
 
+                       printk(MODULE_NAME ": hotplugbutton '%s, %s, %ld'\n", b->pressed?"pressed":"released",b->name, (jiffies - b->seen)/HZ);
                        INIT_WORK(&event->wq, (void *)(void *)hotplug_button, (void *)event);
                        schedule_work(&event->wq);
                }

The results are (right after the mtd -r <blaat> linux, and not pressing anything):

root@(none):/# dmesg|tail -5
<4>Probing device eth3: No such device
<6>b44: eth0: Link is up at 100 Mbps, full duplex.
<6>b44: eth0: Flow control is off for TX and off for RX.
<4>diag: hotplugbutton 'pressed, reset, 5'
<4>diag: hotplugbutton 'released, reset, 0'
root@(none):/# 

I've tested the reset key with a custom hotplug script, and it works, so it is not a question of a stuck reset key.
(BTW: I just love the way you keep the switch ports isolated, and still broadcast the message "press the reset button key". Nice detail ;-) ).

I will try to look at the changelog which change might cause this. I think #983 is not the culprit, since that only affects the bitstream to the switch, not any I/O ports. (And catting /proc/switch/eth0/registers does not generate a new reset).

Attachments (0)

Change History (6)

comment:1 Changed 9 years ago by mbm

  • Owner changed from developers to mbm

Check if

comment:2 Changed 9 years ago by mbm

Check if resetting the switch triggers it -

The WRT54GS v1 had an adm6996L switch on it, which uses some of the same gpio pins as diag does; I wouldn't be too surprised if the false message came when preinit was doing the 'echo 1 > /proc/switch/eth0/reset'

comment:3 Changed 9 years ago by ard@…

Good thinking, you are absolutely correct:

root@(none):/# dmesg|tail -5;echo 1 > /proc/switch/eth0/reset ;dmesg|tail -5
<4>Probing device eth3: No such device
<6>b44: eth0: Link is up at 100 Mbps, full duplex.
<6>b44: eth0: Flow control is off for TX and off for RX.
<4>diag: hotplugbutton 'pressed, reset, 5'
<4>diag: hotplugbutton 'released, reset, 0'
<6>b44: eth0: Flow control is off for TX and off for RX.
<4>diag: hotplugbutton 'pressed, reset, 5'
<4>diag: hotplugbutton 'released, reset, 0'
<4>diag: hotplugbutton 'pressed, reset, 42465'
<4>diag: hotplugbutton 'released, reset, 0'

Heh... it works in so far that I actually can see that it triggers it, before it shuts down the ports :-).
Hmmmm, I will temporarily put a 2 second sleep after the switch reset, so I can give #983 some more testing, and have some nice Munin graphs.
A good fix on kernel level is probably hard, since they both live in separate packages. Hmmm, if diag exports a "mute" symbol, that can be used by the switch driver to temporarily mute the reset key detection.
But first the 2 second sleep, since reflashing the device everytime is probably not that healthy.

comment:4 Changed 9 years ago by ard@…

Just moving the initialization of the hotplug fixes it. As a precaution I've used true as hotplug handler, until after the message has been broadcast.

ard@asus1:~/nas/src/openwrt/svn/trunk$ svn diff target/linux/brcm-2.4/base-files/etc/preinit 
Index: target/linux/brcm-2.4/base-files/etc/preinit
===================================================================
--- target/linux/brcm-2.4/base-files/etc/preinit        (revision 5684)
+++ target/linux/brcm-2.4/base-files/etc/preinit        (working copy)
@@ -31,8 +31,6 @@
 
 insmod diag
 set_state preinit
-trap 'FAILSAFE=true' USR1
-echo '/sbin/hotplug.failsafe' > /proc/sys/kernel/hotplug
 
 ifname=eth0
 
@@ -49,6 +47,9 @@
 
 ifconfig $ifname 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up
 
+trap 'FAILSAFE=true' USR1
+echo '/bin/true' > /proc/sys/kernel/hotplug
+
 [ -d /proc/switch/eth0 ] && {
        echo 1 > /proc/switch/eth0/reset
 
@@ -59,6 +60,7 @@
                netmsg 192.168.1.255 "Press reset now, to enter Failsafe!"
        }; done
 } || netmsg 192.168.1.255 "Press reset now, to enter Failsafe!"
+echo '/sbin/hotplug.failsafe' > /proc/sys/kernel/hotplug
 
 sleep 2

And some minor things that should not be changed. Anyway, you get the idea.

comment:5 Changed 9 years ago by mbm

  • Resolution set to fixed
  • Status changed from new to closed

fixed in [5687]

(should also help people using mmc with the diag module loaded)

comment:6 Changed 22 months ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.