Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: epicsAtExit
From: Eric Norum <eric@norum.ca>
To: Mark Rivers <rivers@cars.uchicago.edu>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 28 Jun 2012 08:23:28 -0700
I doubt that VME addresses would be cached.   There may be an issue with write-posting between the processor and the VME module, though.
It's usually a good idea to perform a dummy read from a VME module after writes that mess with interrupt registers -- this forces the processor to wait until the writes have percolated through the various levels of bus adapters in modern VME processor cards.

On Jun 27, 2012, at 9:01 PM, Mark Rivers wrote:

> Hi Zen,
> 
> With the asyn driver do you see the printf message, i.e. is the  drvV792::rebootCb()  function being called?
> 
> Perhaps the VME writes to disable interrupts are not actually being done because they are cached, and the cache is never flushed before the system shuts down.  Have you declared ILEV and EVTR  to be volatile? What happens if you do a read from those registers after the writes, which should flush the cache?
> 
> Mark
> 
> ________________________________
> From: Szalata, Zenon M. [zms@slac.stanford.edu]
> Sent: Wednesday, June 27, 2012 7:40 PM
> To: Mark Rivers; Williams Jr., Ernest L.
> Cc: tech-talk@aps.anl.gov
> Subject: epicsAtExit
> 
> Hi Mark,
> I have a problem, which I have been ignoring for a while.
> I have a device driver for a VME module based on asynPortDriver class.  It is used with asyn R4.18, EPICS R3.14.12.2, vxWorks 6.6.
> I have coded a couple of routines to disable interrupts when the IOC is shutdown (with CTRL-X), which does not work.  Restarting the IOC which uses the asyn based driver with CTRL-X fails to come up.  The IOC reaches some point in the booting sequence and then I suppose it crashes because the boot starts all over.  I recover from that with a VME reset.  Also, if I disable interrupts before rebooting all works fine.
> I have created another device driver using the conventional approach, which does not use asyn.  As far as I can tell most of the code if not the same is equivalent.  With this device driver the interrupts get disabled on exit.
> This is what I have in the asynPortDriver version of the device driver:
> 
> In the constructor I have:
> 
>  epicsAtExit( rebootCbC,this);
> 
> then I have:
> 
> extern "C"{
> …
> static void rebootCbC( void* pvt){
>  drvV792* pthis=(drvV792*)pvt;
>  pthis->rebootCb();
> }
> }
> 
> void drvV792::rebootCb(){
> //------------------------------------------------------------------------------
>  printf( "%s::rebootCb: Interrupts disabled and Soft reset\n",dname);
>  fflush(stdout);
>  epicsThreadSleep(1.0);
>  _wtReg( ILEV,0);
>  _wtReg( EVTR,0);
> }
> 
> Writing 0 to the EVTR disables interrupts.  Also writing 0 to the ILEV register disables interrupts.
> In fact, the same rebootCB code, seems to work fine in the non-asyn driver.
> Is something subtle taking place because of vxWorks?
> Can you offer suggestion on how to make it work?
> Thanks in advance,
> Zen
> 
> 

-- 
Eric Norum
eric@norum.ca






References:
epicsAtExit Szalata, Zenon M.
RE: epicsAtExit Mark Rivers

Navigate by Date:
Prev: Re: caget limitation retreiving ENUM list Andrew Johnson
Next: Re: LabVIEW EPICS connection Dale L. Brewe
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: RE: epicsAtExit Mark Rivers
Next: RE: epicsAtExit Szalata, Zenon M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·