* immap_8260.h: volatile missing in immr definition
@ 2002-09-06 11:49 Hans dot Feldt at uab.ericsson.se
2002-09-06 14:30 ` Dan Malek
0 siblings, 1 reply; 2+ messages in thread
From: Hans dot Feldt at uab.ericsson.se @ 2002-09-06 11:49 UTC (permalink / raw)
To: linuxppc-embedded
I've been trying to get the watchdog timer to run in a 2.4.18 kernel
on our custom 750/8260 board. Finally I realised what was the problem
by disassembling with objdump. Due to the missing volatile declaration,
the dog kicking code
immr->im_siu_conf.sc_swsr = 0x556c;
immr->im_siu_conf.sc_swsr = 0xaa39;
gets optimised into this by gcc:
immr->im_siu_conf.sc_swsr = 0xaa39;
which don't make the dog happy.
Sorry if this is an old issue, I searched for it and couldn't find
anything. The patches for 2.4.18 does not contain this fix.
I don't know how it works but could someone who feel responsible change
the original source please?
Change from: extern immap_t *immr:
to: extern volatile immap_t *immr;
The actual variable declaration in 8260_io/commproc.c should probably
be volatiled to.
The system now boots with a 1.8s watchdog timer!
Cheers,
Hans
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: immap_8260.h: volatile missing in immr definition
2002-09-06 11:49 immap_8260.h: volatile missing in immr definition Hans dot Feldt at uab.ericsson.se
@ 2002-09-06 14:30 ` Dan Malek
0 siblings, 0 replies; 2+ messages in thread
From: Dan Malek @ 2002-09-06 14:30 UTC (permalink / raw)
To: Hans dot Feldt at uab.ericsson.se; +Cc: linuxppc-embedded
Hans dot Feldt at uab.ericsson.se wrote:
> Change from: extern immap_t *immr:
> to: extern volatile immap_t *immr;
Rather than do this, I would prefer you use a function local variable
and load the global immr into it. You should also get into the habit
of using barrier operations between such I/O accesses that must be
properly ordered. The global volatile declaration isn't sufficient
to enforce ordered operations. You just got lucky this time.
Thanks.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-06 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-06 11:49 immap_8260.h: volatile missing in immr definition Hans dot Feldt at uab.ericsson.se
2002-09-06 14:30 ` Dan Malek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).