Modify

Opened 9 years ago

Closed 9 years ago

#2285 closed enhancement (fixed)

AR7 watchdog fix

Reported by: Axel Gembe Owned by: developers
Priority: normal Milestone:
Component: kernel Version:
Keywords: Cc:

Description

Please test if this makes your watchdog work again. It works for me with r8250 on the Fritz!Box

Attachments (5)

ar7-wdt.patch (2.6 KB) - added by Axel Gembe 9 years ago.
Watchdog patch
ar7-wdt-07-09-2007.patch (2.7 KB) - added by Axel Gembe 9 years ago.
AR7 Watchdog Fix without volatile
ar7-wdt-codingstyle-07-09-2007.patch (6.8 KB) - added by Axel Gembe 9 years ago.
Watchdog Fix with coding style fixes
ar7-wdt-codingstyle-012-09-2007.patch (4.2 KB) - added by Axel Gembe 9 years ago.
Watchdog Fix with coding style fixes *updated*
ar7-wdt-volatile-12-09-2007.patch (2.7 KB) - added by Axel Gembe 9 years ago.
Watchdog volatile patch

Download all attachments as: .zip

Change History (15)

Changed 9 years ago by Axel Gembe

Watchdog patch

comment:1 Changed 9 years ago by rootkit85@…

Doesn't works for me:

[/]# killall watchdog
[/]# dmesg |fgrep wdt
ar7_wdt: disabling watchdog timer
ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq 62500000)
ar7_wdt: enabling watchdog timer
ar7_wdt: watchdog device closed unexpectedly, will not disable the watchdog timer
[/]# date
Mon Sep  3 23:20:14 UTC 2007
[/]# date
Mon Sep  3 23:25:01 UTC 2007

comment:2 Changed 9 years ago by florian

Your code does not change anything, and I do not see the point in remaping the I/O for every function you call.

comment:3 Changed 9 years ago by Axel Gembe

Well, for me this clearly makes the watchdog work, before that it coulnd't unlock it. Don't really know why, but I think it might be related to the volatile keyword and gcc optimizing away the later if blocks.

Also, the code in the ar7_wdt_write is wrong and gets corrected by the patch. No other watchdog code I've seen does return -ESPIPE there. The watchdog program kicked the watchdog only one time and then the watchdog started returning -ESPIPE on writes all the time which led to a restart loop.

comment:4 Changed 9 years ago by Axel Gembe

The new patch in ar7-wdt-07-09-2007.patch should be cleaner, using the Linux I/O functions instead of volatile (I know that it uses volatile internally) and remapping the I/O memory only on startup. I didn't test it yet, but you should see what I meant it to do. I will post the results of the tests later.

Changed 9 years ago by Axel Gembe

AR7 Watchdog Fix without volatile

comment:5 Changed 9 years ago by Axel Gembe

There are some coding style fixes in the newest patch.

Changed 9 years ago by Axel Gembe

Watchdog Fix with coding style fixes

Changed 9 years ago by Axel Gembe

Watchdog Fix with coding style fixes *updated*

comment:6 Changed 9 years ago by anonymous

Updated coding style fixes for rev 8758...

comment:7 Changed 9 years ago by matteo

You may want to define 2 macros:

#define READ_REG(x) readl((void __iomem*)&(x))
#define WRITE_REG(x,v) writel((void __iomem*)&(x), (v));

comment:8 Changed 9 years ago by matteo

Btw I've applied your coding styles. many thanks

comment:9 Changed 9 years ago by Axel Gembe

Here is a patch that uses READ_REG / WRITE_REG instead of direct volatile access.

Changed 9 years ago by Axel Gembe

Watchdog volatile patch

comment:10 Changed 9 years ago by matteo

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

Apart that x and v were swapped it works.
Tnx Axel

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.