Device driver - Unable to recover after a soft reset

I have a working version of a PCI-PCLTA device driver which works under
Linux and Windows, and I have adapted it for QNX 4. Everything works
correctly except for one problem - after a soft reset on the computer, the
entire system freezes once the device driver tries accessing the PCI Bus.
When the hard reset occurs (power down computer and restore power)
everything works correctly until the next soft reset (Ctrl-Alt-Shift-Del or
the reset button). There are no interrupt conflicts, and it appears to be a
problem with initialization of the PCI bus. In the case of the hard reset,
the BIOS does a plug and play initialization for the PCI bus, in the case of
the soft reset it does not.

Is there a simple way to initialize the PCI bus after a soft reset?
What other problems could cause this to happen?
Does anyone have any ideas?

Thanks,
Gordon M.

Hi Gordon,

I am going to ask around here to see if anyone has any suggestions.

E.


Gordon Morganson <nospamtrueliving2000@msn.com> wrote:

I have a working version of a PCI-PCLTA device driver which works under
Linux and Windows, and I have adapted it for QNX 4. Everything works
correctly except for one problem - after a soft reset on the computer, the
entire system freezes once the device driver tries accessing the PCI Bus.
When the hard reset occurs (power down computer and restore power)
everything works correctly until the next soft reset (Ctrl-Alt-Shift-Del or
the reset button). There are no interrupt conflicts, and it appears to be a
problem with initialization of the PCI bus. In the case of the hard reset,
the BIOS does a plug and play initialization for the PCI bus, in the case of
the soft reset it does not.

Is there a simple way to initialize the PCI bus after a soft reset?
What other problems could cause this to happen?
Does anyone have any ideas?

Thanks,
Gordon M.

Hi Gordon,

QNX4 relies on the PCI bios to setup the bus, so there is no way to
re-initialize the bus. I would place some debug printf’s into the
device driver and see at what stage it hangs. Is the device driver
catching the SIGPWR signal and shutting down gracefully?

Erick.


Hardware Support Account <hw@qnx.com> wrote:

Hi Gordon,

I am going to ask around here to see if anyone has any suggestions.

E.



Gordon Morganson <> nospamtrueliving2000@msn.com> > wrote:
I have a working version of a PCI-PCLTA device driver which works under
Linux and Windows, and I have adapted it for QNX 4. Everything works
correctly except for one problem - after a soft reset on the computer, the
entire system freezes once the device driver tries accessing the PCI Bus.
When the hard reset occurs (power down computer and restore power)
everything works correctly until the next soft reset (Ctrl-Alt-Shift-Del or
the reset button). There are no interrupt conflicts, and it appears to be a
problem with initialization of the PCI bus. In the case of the hard reset,
the BIOS does a plug and play initialization for the PCI bus, in the case of
the soft reset it does not.

Is there a simple way to initialize the PCI bus after a soft reset?
What other problems could cause this to happen?
Does anyone have any ideas?

Thanks,
Gordon M.

Thanks Erick,

After digging deeper into the device driver code, and adding code to the
interrupt routine I have located the problem. The issue is not the PCI bus
but the problem is related more to interrupts and how the PCI PCLTA card
handles those interrupts after a soft reset. During a Soft Reset the PCI
PCLTA card is causing an extremely large number of interrupts to occur
before the Driver has finished intializing the card, even though the
interrupts are being acknowledged in the interrupt routine, the PCI PCLTA
card (still uninitialized) was not turning off the interrupt.

The solution was to check in the interrupt routine for correct
intialization. When the card was not initialized to disallow access to most
Control Registers of the PCI PCLTA card.

Question: What is the best method for debugging an interrupt routine??

Thanks for the suggestions and added information.

Problem Resolved.
Gordon.


“Hardware Support Account” <hw@qnx.com> wrote in message
news:a1f71m$j7i$1@nntp.qnx.com

Hi Gordon,

QNX4 relies on the PCI bios to setup the bus, so there is no way to
re-initialize the bus. I would place some debug printf’s into the
device driver and see at what stage it hangs. Is the device driver
catching the SIGPWR signal and shutting down gracefully?

Erick.


Hardware Support Account <> hw@qnx.com> > wrote:
Hi Gordon,

I am going to ask around here to see if anyone has any suggestions.

E.


Gordon Morganson <> nospamtrueliving2000@msn.com> > wrote:
I have a working version of a PCI-PCLTA device driver which works under
Linux and Windows, and I have adapted it for QNX 4. Everything works
correctly except for one problem - after a soft reset on the computer,
the
entire system freezes once the device driver tries accessing the PCI
Bus.
When the hard reset occurs (power down computer and restore power)
everything works correctly until the next soft reset
(Ctrl-Alt-Shift-Del or
the reset button). There are no interrupt conflicts, and it appears to
be a
problem with initialization of the PCI bus. In the case of the hard
reset,
the BIOS does a plug and play initialization for the PCI bus, in the
case of
the soft reset it does not.

Is there a simple way to initialize the PCI bus after a soft reset?
What other problems could cause this to happen?
Does anyone have any ideas?

Thanks,
Gordon M.

“Gordon Morganson” <nospamtrueliving2000@msn.com> wrote in message
news:a1htgl$bmv$1@inn.qnx.com

Thanks Erick,

After digging deeper into the device driver code, and adding code to the
interrupt routine I have located the problem. The issue is not the PCI
bus
but the problem is related more to interrupts and how the PCI PCLTA card
handles those interrupts after a soft reset. During a Soft Reset the PCI
PCLTA card is causing an extremely large number of interrupts to occur
before the Driver has finished intializing the card, even though the
interrupts are being acknowledged in the interrupt routine, the PCI PCLTA
card (still uninitialized) was not turning off the interrupt.

The solution was to check in the interrupt routine for correct
intialization. When the card was not initialized to disallow access to
most
Control Registers of the PCI PCLTA card.

Question: What is the best method for debugging an interrupt routine??

I often rely on Trace() function to kind of like to printf from within an
interrupt.

On the more fancy side a bus analyser is often the best, but damn expensive!

Thanks for the suggestions and added information.

Problem Resolved.
Gordon.


“Hardware Support Account” <> hw@qnx.com> > wrote in message
news:a1f71m$j7i$> 1@nntp.qnx.com> …
Hi Gordon,

QNX4 relies on the PCI bios to setup the bus, so there is no way to
re-initialize the bus. I would place some debug printf’s into the
device driver and see at what stage it hangs. Is the device driver
catching the SIGPWR signal and shutting down gracefully?

Erick.


Hardware Support Account <> hw@qnx.com> > wrote:
Hi Gordon,

I am going to ask around here to see if anyone has any suggestions.

E.


Gordon Morganson <> nospamtrueliving2000@msn.com> > wrote:
I have a working version of a PCI-PCLTA device driver which works
under
Linux and Windows, and I have adapted it for QNX 4. Everything works
correctly except for one problem - after a soft reset on the
computer,
the
entire system freezes once the device driver tries accessing the PCI
Bus.
When the hard reset occurs (power down computer and restore power)
everything works correctly until the next soft reset
(Ctrl-Alt-Shift-Del or
the reset button). There are no interrupt conflicts, and it appears
to
be a
problem with initialization of the PCI bus. In the case of the hard
reset,
the BIOS does a plug and play initialization for the PCI bus, in the
case of
the soft reset it does not.

Is there a simple way to initialize the PCI bus after a soft reset?
What other problems could cause this to happen?
Does anyone have any ideas?

Thanks,
Gordon M.
\

Gordon Morganson <nospamtrueliving2000@msn.com> wrote:

Thanks Erick,

After digging deeper into the device driver code, and adding code to the
interrupt routine I have located the problem. The issue is not the PCI bus
but the problem is related more to interrupts and how the PCI PCLTA card
handles those interrupts after a soft reset. During a Soft Reset the PCI
PCLTA card is causing an extremely large number of interrupts to occur
before the Driver has finished intializing the card, even though the
interrupts are being acknowledged in the interrupt routine, the PCI PCLTA
card (still uninitialized) was not turning off the interrupt.

The solution was to check in the interrupt routine for correct
intialization. When the card was not initialized to disallow access to most
Control Registers of the PCI PCLTA card.

Question: What is the best method for debugging an interrupt routine??

Take a look at debugger32, that is usually the best method.

Erick.