I'm writing a driver for a PCI-Express device, although the "-Express" part
should be irrelevant for this discussion. I started the driver from Walter
Oney's driver wizard, and the power management code is essentially
unchanged from the wizard code. Windows XP SP1a Checked. (I haven't tried
Free; I suppose I should...)

I can load, unload, and restart the driver to my heart's content. On a
system restart, power state goes to D3, driver unloads, everything is
happy. But when I try to do a system shutdown, most of the time it gets
everything shut down, my power state goes to D3, my driver (apparently)
unloads, the kernel debugger disconnects and waits for a reconnect, the
screen goes to blue, and that's it. The power doesn't go off. SOMETIMES a
shutdown works fine, but most of the time, I get this hang. If our device
is not plugged in, it shuts down OK.

Anybody have any wild ideas for me to try? I don't THINK it is a driver
issue; I don't think the debugger would disconnect if my driver were still
running. Any "I saw this once and here's what I did" stories welcome.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: Strange Shutdown Problem by Doron

Doron
Sat May 29 22:50:39 CDT 2004

are you disconnecting your interrupt when you go to D3? perhaps your device
is causing an interrupt storm which is being left unacknowledged.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Tim Roberts" <timr@probo.com> wrote in message
news:ot3ib0tprcg11l9i8qd8ub14bi00a9rhmg@4ax.com...
> I'm writing a driver for a PCI-Express device, although the "-Express"
part
> should be irrelevant for this discussion. I started the driver from
Walter
> Oney's driver wizard, and the power management code is essentially
> unchanged from the wizard code. Windows XP SP1a Checked. (I haven't
tried
> Free; I suppose I should...)
>
> I can load, unload, and restart the driver to my heart's content. On a
> system restart, power state goes to D3, driver unloads, everything is
> happy. But when I try to do a system shutdown, most of the time it gets
> everything shut down, my power state goes to D3, my driver (apparently)
> unloads, the kernel debugger disconnects and waits for a reconnect, the
> screen goes to blue, and that's it. The power doesn't go off. SOMETIMES
a
> shutdown works fine, but most of the time, I get this hang. If our device
> is not plugged in, it shuts down OK.
>
> Anybody have any wild ideas for me to try? I don't THINK it is a driver
> issue; I don't think the debugger would disconnect if my driver were still
> running. Any "I saw this once and here's what I did" stories welcome.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc



Re: Strange Shutdown Problem by Tim

Tim
Mon May 31 18:12:39 CDT 2004

"Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote:
>
>are you disconnecting your interrupt when you go to D3? perhaps your device
>is causing an interrupt storm which is being left unacknowledged.

That's worth double-checking, but I don't think so. I set a "disable
interrupts" flag in the device as I'm going away, and I do have some
evidence that it has the desried effect on the device. Plus, the firmware
sends a message to a debug UART port every time it asserts an interrupt,
and I'm not seeing any messages when this happens.

This does bring up a question, one that I will be able to answer myself
when I get back in to the office. Should my driver actually get unloaded
during a shutdown, or do I just transition to D3 and stay in memory? Maybe
I'm not doing my close processing in the right spot.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: Strange Shutdown Problem by Doron

Doron
Tue Jun 01 00:21:57 CDT 2004

during system shutdown the driver is not unloaded. you need to put your
device into a d3 state though. even though you turned off interrupts at the
device level, you should still disconnect the interrupt via
IoDisconnectInterrupt so that the (A)PIC can be programmed to turn off the
interrupt in HW if you are the last device on that line.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Tim Roberts" <timr@probo.com> wrote in message
news:6oenb0lt6br8ck5jqh9kr80nh55n845ist@4ax.com...
> "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote:
> >
> >are you disconnecting your interrupt when you go to D3? perhaps your
device
> >is causing an interrupt storm which is being left unacknowledged.
>
> That's worth double-checking, but I don't think so. I set a "disable
> interrupts" flag in the device as I'm going away, and I do have some
> evidence that it has the desried effect on the device. Plus, the firmware
> sends a message to a debug UART port every time it asserts an interrupt,
> and I'm not seeing any messages when this happens.
>
> This does bring up a question, one that I will be able to answer myself
> when I get back in to the office. Should my driver actually get unloaded
> during a shutdown, or do I just transition to D3 and stay in memory?
Maybe
> I'm not doing my close processing in the right spot.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc