PCIe device cannot start (Code 10) on Windows 7

Hi All,

I have a driver for a PCIe device which fails to start on Win 7 (it works fine on XP).
In the Device Manager, it says “This device cannot start. (Code 10-CM_PROB_FAILED_START)” for Device status.I test other windows OS,found that on XP/2003 the driver is OK,on Vista/2008/windows 7 have Code 10 problem.

I traced the driver and found that DriverEntry and AddDevice passed(return OK).
After that it call cleanup callback EvtCleanupCallback.EvtDevicePrepareHardware can not be called.

I searched the setupapi.dev.log,found this information:
!!! dvi: Device not started: Device has problem: 0x0a: CM_PROB_FAILED_START.

I found some topics about this similar problem(Code 10–CM_PROB_FAILED_START) in OSR’s ntdev List.But it seemed that this problem have no clear solution.

I’m not sure how to determine what it is that Win 7 is unhappy about (compared to XP).
Any ideas? Pointers where to look?

Any help is appreciated.Thanks.

Best Regards
ZCJ

!Wdfkd.wdflogdump

Will tell you where it is failing and with what NTSTATUS code.

d

debt from my phone

-----Original Message-----
From: xxxxx@yahoo.com.cn
Sent: Tuesday, June 14, 2011 7:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] PCIe device cannot start (Code 10) on Windows 7

Hi All,

I have a driver for a PCIe device which fails to start on Win 7 (it works fine on XP).
In the Device Manager, it says “This device cannot start. (Code 10-CM_PROB_FAILED_START)” for Device status.I test other windows OS,found that on XP/2003 the driver is OK,on Vista/2008/windows 7 have Code 10 problem.

I traced the driver and found that DriverEntry and AddDevice passed(return OK).
After that it call cleanup callback EvtCleanupCallback.EvtDevicePrepareHardware can not be called.

I searched the setupapi.dev.log,found this information:
!!! dvi: Device not started: Device has problem: 0x0a: CM_PROB_FAILED_START.

I found some topics about this similar problem(Code 10–CM_PROB_FAILED_START) in OSR’s ntdev List.But it seemed that this problem have no clear solution.

I’m not sure how to determine what it is that Win 7 is unhappy about (compared to XP).
Any ideas? Pointers where to look?

Any help is appreciated.Thanks.

Best Regards
ZCJ


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@yahoo.com.cn wrote:

I have a driver for a PCIe device which fails to start on Win 7 (it works fine on XP).
In the Device Manager, it says “This device cannot start. (Code 10-CM_PROB_FAILED_START)” for Device status.I test other windows OS,found that on XP/2003 the driver is OK,on Vista/2008/windows 7 have Code 10 problem.

I traced the driver and found that DriverEntry and AddDevice passed(return OK).
After that it call cleanup callback EvtCleanupCallback. EvtDevicePrepareHardware can not be called.

I searched the setupapi.dev.log,found this information:
!!! dvi: Device not started: Device has problem: 0x0a: CM_PROB_FAILED_START.

Have you looked at the KMDF in-flight recorder log (!wdflogdump)? That
should have more information.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks.
I encountered some problem while try to use !wdflogdump,I will try this postpone.

Today I try to use general method to handle the IRP_MN_START_DEVICE PnP request.
When I call IoCallDriver,it failed,status is 0xC0000001(STATUS_UNSUCCESSFUL) on windows 7.
On XP general Driver also works fine.

Here is the relevant code:

handle the IRP_MN_START_DEVICE PnP request


KEVENT WaitEvent;
NTSTATUS status;

// Initialize a kernel event object to wait for lower-level driver IRP processing
KeInitializeEvent(
&WaitEvent,
NotificationEvent,
FALSE
);

IoCopyCurrentIrpStackLocationToNext(pIrp);

IoSetCompletionRoutine(
pIrp,
PnP_OnRequestComplete,
&WaitEvent,
TRUE,
TRUE,
TRUE
);

status =
IoCallDriver(
((DEVICE_EXTENSION*)fdo->DeviceExtension)->pLowerDeviceObject,
pIrp
);

if (status == STATUS_PENDING)
{
// Wait for completion
KeWaitForSingleObject(
&WaitEvent,
Executive,
KernelMode,
FALSE,
NULL
);

return pIrp->IoStatus.Status;
}

return status; //I traced,return from this path.On XP status is 0,On windows 7 is 0xC0000001

NTSTATUS
PnP_OnRequestComplete(
PDEVICE_OBJECT fdo,
PIRP pIrp,
PKEVENT pKEvent
)
{
KeSetEvent(pKEvent,0,FALSE);

return STATUS_MORE_PROCESSING_REQUIRED;
}

The system pcie driver could not start your device, I would strongly suspect a hw problem. XP is not pcie enabled, so on XP it is treated like a PCI device , w7 is pcie enabled and treats it like an express device, so I suggest you look at that part of your hw

d

debt from my phone

-----Original Message-----
From: xxxxx@yahoo.com.cn
Sent: Friday, June 17, 2011 7:28 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCIe device cannot start (Code 10) on Windows 7

Thanks.
I encountered some problem while try to use !wdflogdump,I will try this postpone.

Today I try to use general method to handle the IRP_MN_START_DEVICE PnP request.
When I call IoCallDriver,it failed,status is 0xC0000001(STATUS_UNSUCCESSFUL) on windows 7.
On XP general Driver also works fine.

Here is the relevant code:

handle the IRP_MN_START_DEVICE PnP request


KEVENT WaitEvent;
NTSTATUS status;

// Initialize a kernel event object to wait for lower-level driver IRP processing
KeInitializeEvent(
&WaitEvent,
NotificationEvent,
FALSE
);

IoCopyCurrentIrpStackLocationToNext(pIrp);

IoSetCompletionRoutine(
pIrp,
PnP_OnRequestComplete,
&WaitEvent,
TRUE,
TRUE,
TRUE
);

status =
IoCallDriver(
((DEVICE_EXTENSION*)fdo->DeviceExtension)->pLowerDeviceObject,
pIrp
);

if (status == STATUS_PENDING)
{
// Wait for completion
KeWaitForSingleObject(
&WaitEvent,
Executive,
KernelMode,
FALSE,
NULL
);

return pIrp->IoStatus.Status;
}

return status; //I traced,return from this path.On XP status is 0,On windows 7 is 0xC0000001

NTSTATUS
PnP_OnRequestComplete(
PDEVICE_OBJECT fdo,
PIRP pIrp,
PKEVENT pKEvent
)
{
KeSetEvent(pKEvent,0,FALSE);

return STATUS_MORE_PROCESSING_REQUIRED;
}


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

wrote in message news:xxxxx@ntdev…
> Thanks.
> I encountered some problem while try to use !wdflogdump,I will try this
> postpone.

Sure, if your driver does not use KMDF, some problem with !wdflogdump is
expected.

–pa

> Today I try to use general method to handle the IRP_MN_START_DEVICE PnP
> request.
> When I call IoCallDriver,it failed,status is
> 0xC0000001(STATUS_UNSUCCESSFUL) on windows 7.
> On XP general Driver also works fine.
>
> Here is the relevant code:
>
> handle the IRP_MN_START_DEVICE PnP request
>
> …
> KEVENT WaitEvent;
> NTSTATUS status;
>
> // Initialize a kernel event object to wait for lower-level driver IRP
> processing
> KeInitializeEvent(
> &WaitEvent,
> NotificationEvent,
> FALSE
> );
>
> IoCopyCurrentIrpStackLocationToNext(pIrp);
>
> IoSetCompletionRoutine(
> pIrp,
> PnP_OnRequestComplete,
> &WaitEvent,
> TRUE,
> TRUE,
> TRUE
> );
>
> status =
> IoCallDriver(
> ((DEVICE_EXTENSION*)fdo->DeviceExtension)->pLowerDeviceObject,
> pIrp
> );
>
> if (status == STATUS_PENDING)
> {
> // Wait for completion
> KeWaitForSingleObject(
> &WaitEvent,
> Executive,
> KernelMode,
> FALSE,
> NULL
> );
>
> return pIrp->IoStatus.Status;
> }
>
> return status; //I traced,return from this path.On XP status is 0,On
> windows 7 is 0xC0000001
> …
>
> NTSTATUS
> PnP_OnRequestComplete(
> PDEVICE_OBJECT fdo,
> PIRP pIrp,
> PKEVENT pKEvent
> )
> {
> KeSetEvent(pKEvent,0,FALSE);
>
> return STATUS_MORE_PROCESSING_REQUIRED;
> }
>

3ks.Doron Holan.
I also test on other OS,xp/2003 is OK,vista/2008/windows 7 has the same problem.

Can I do something that change windows 7 from pcie enabled to disabled in our PCIe device function driver?
Well,our device is an express device.Since windows 7 is pcie enabled.It seems no problem.

HW problem?Can you give me some advice to check?
Such our device does not meet PCI express Specification and …?

3ks.

First I used KMDF,but !wdflogdump can not worked.
I think maybe the environment built is not correct.
So I changed this driver to general,not use KMDF.

Sure, if your driver does not use KMDF, some problem with !wdflogdump is
expected.

XP and 2003 are not pcie aware. Vista, 2008 and w7 are. Pretty clear it is a pcie specific problem

d

debt from my phone

-----Original Message-----
From: xxxxx@yahoo.com.cn
Sent: Friday, June 17, 2011 8:21 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PCIe device cannot start (Code 10) on Windows 7

3ks.Doron Holan.
I also test on other OS,xp/2003 is OK,vista/2008/windows 7 has the same problem.

Can I do something that change windows 7 from pcie enabled to disabled in our PCIe device function driver?
Well,our device is an express device.Since windows 7 is pcie enabled.It seems no problem.

HW problem?Can you give me some advice to check?
Such our device does not meet PCI express Specification and …?

3ks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Well,Doron.Your mean that our device does not meet PCI express Specification.
Vista/2008/windows 7 is pcie enabled,so when our device call IoCallDriver,
OS(may be PCIe bus driver) check it and then return 0xC0000001(STATUS_UNSUCCESSFUL)?

xxxxx@yahoo.com.cn wrote:

Can I do something that change windows 7 from pcie enabled to disabled in our PCIe device function driver?
Well,our device is an express device. Since windows 7 is pcie enabled. It seems no problem.

HW problem?Can you give me some advice to check?
Such our device does not meet PCI express Specification and …?

Well, does it?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Do !pci command with the necessary arguments to print the config space of your device, and post the output here.

>Do !pci command with the necessary arguments to print the config space of your
device, and post the output here.

Before I install the driver,original config space is:

Configuration Type 0 Registers

04:00100007
08:1
0c:10
10:fbc00000
14:d3000008
18:d2000008
1c:d0000008
20:8
24:0
28:0
2c:00010000
30:0
34:40
38:0
3c:110

PCI Express Capabilities Registers

40:00035001 00000000 00000000 00000000
50:00807005 00000000 00000000 00000000
60:00000000 00000000 00000000 00000000
70:00020010 05908701 00092800 00033422
80:10120040 00000000 00000000 00000000
90:00000000 0000001f 00000000 00000006
a0:00000002 00000000 00000000 00000000
b0:00000000 00000000 00000000 00000000
c0:00000000 00000000 00000000 00000000
d0:00000000 00000000 00000000 00000000
e0:00000000 00000000 00000000 00000000
f0:00000000 00000000 00000000 00000000

After I instal the driver,althougth it failed with code 10.
The config space changed two places:
i.offset 04 STATUS_COMMAND Register 00100007–>00100400

bit 10 INTx Disable Setting this bit disables generation of INTx messages.
bit 2 Bus Master Enables mastership of the bus.
bit 1 Memory Space This bit is set to enable the device to respond to memory accesses.

ii.offset 44 The power management control and status register (PM_CTL_STAT)
00000000–>00000003
bit 1-0 PWR_STATE 0-3h Power State. Controls the device power state.
Writes are ignored if the state is not supported. Writable from internal bus interface.
0 D0 power state
1h D1 power state
2h D2 power state
3h D3 power state

Doron,and I forget to tell you one result that I test.
The chip that I used have two pin that control PCIe 32 BAR Window Size.
One is for BAR2,another is BAR4.
When these two pins are set to 1,BAR2 is 16MB size,BAR4 is 256MB size.
When these two pins are set to 0,the size of BAR2 and BAR4 is 0.

I want to support 10 devices,so when BAR4 is set 256MB.
System space(2GB) exhaust.

When the two pins is set to 1,driver works fine on windows vista/2008/windows 7.
When I change either one of the two pin to 0,device failed to start on Win 7.

So this came a contradiction
if BAR4 is set 256MB,system space problem.
if BAR4 is set to 0,device failed to start on Win 7.

your PCI BAR4 has the “prefetch bit” set. But the window is probably
disabled, since all other bits are zero, which means your device does
not allow the upper bits to be set from the PCI side. Thats valid
according to the PCI specification but not according to Bill.
The IO manager of Windows 7 will not load a KMDF driver for such a
device. It will though load a bare-WDM driver.

If you put your device in a checked build of Windows 7 it will crash
when starting its PCI.sys. Sometimes you will see a BSOD, other times
nothing, a hang or a reboot, depending on the weather.

If you can change your firmware (i.e. you don’t have any devices
released yet) you should enable this Windows (if you don’t need it,
set it to 4k). If you already released a device then your users are
doomed, as you cannot update your firmware, if Windows rejects the
driver.

This issue has been lengthy discussed on this list, what not means
that there are any solutions (yet).

Best regards,
Hagen.

On Sat, Jun 18, 2011 at 1:36 PM, wrote:
> Doron,and I forget to tell you one result that I test.
> The chip that I used have two pin that control PCIe 32 BAR Window Size.
> One is for BAR2,another is BAR4.
> When these two pins are set to 1,BAR2 is 16MB size,BAR4 is 256MB size.
> When these two pins are set to 0,the size of BAR2 and BAR4 is 0.
>
> I want to support 10 devices,so when BAR4 is set 256MB.
> System space(2GB) exhaust.
>
> When the two pins is set to 1,driver works fine on windows vista/2008/windows 7.
> When I change either one of the two pin to 0,device failed to start on Win 7.
>
> So this came a contradiction
> if ?BAR4 is set 256MB,system space problem.
> if ?BAR4 is set to 0,device failed to start on Win 7.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

3ks.Hagen.

It will though load a bare-WDM driver.

Since it will load a bare-WDM driver,why device still fails to start when I change
our device’s function driver to WDM model?

>The IO manager of Windows 7 will not load a KMDF driver for such a
device. It will though load a bare-WDM driver.

i have no idea what this means. the io and pnp manager are not aware that a driver is KMDF or not. KMDF does not do anything PCI (or any other bus specific) aware action. perhaps KMDF is more strict about an NTSTATUS or something, but every instance of start worked in wdm and failed in KMDF, i don’t really see what KMDF is doing differently

It does NOT mean you should move to a WDM driver, it means you need to fix your hw

d


From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] on behalf of hagen [xxxxx@dynax.at]
Sent: Saturday, June 18, 2011 5:56 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] PCIe device cannot start (Code 10) on Windows 7

your PCI BAR4 has the “prefetch bit” set. But the window is probably
disabled, since all other bits are zero, which means your device does
not allow the upper bits to be set from the PCI side. Thats valid
according to the PCI specification but not according to Bill.
The IO manager of Windows 7 will not load a KMDF driver for such a
device. It will though load a bare-WDM driver.

If you put your device in a checked build of Windows 7 it will crash
when starting its PCI.sys. Sometimes you will see a BSOD, other times
nothing, a hang or a reboot, depending on the weather.

If you can change your firmware (i.e. you don’t have any devices
released yet) you should enable this Windows (if you don’t need it,
set it to 4k). If you already released a device then your users are
doomed, as you cannot update your firmware, if Windows rejects the
driver.

This issue has been lengthy discussed on this list, what not means
that there are any solutions (yet).

Best regards,
Hagen.

On Sat, Jun 18, 2011 at 1:36 PM, wrote:
> Doron,and I forget to tell you one result that I test.
> The chip that I used have two pin that control PCIe 32 BAR Window Size.
> One is for BAR2,another is BAR4.
> When these two pins are set to 1,BAR2 is 16MB size,BAR4 is 256MB size.
> When these two pins are set to 0,the size of BAR2 and BAR4 is 0.
>
> I want to support 10 devices,so when BAR4 is set 256MB.
> System space(2GB) exhaust.
>
> When the two pins is set to 1,driver works fine on windows vista/2008/windows 7.
> When I change either one of the two pin to 0,device failed to start on Win 7.
>
> So this came a contradiction
> if BAR4 is set 256MB,system space problem.
> if BAR4 is set to 0,device failed to start on Win 7.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

> It does NOT mean you should move to a WDM driver, it means you need to fix

your hw

you mean our Motorola Embedded PPC?

d


From: xxxxx@lists.osr.com [xxxxx@lists.osr.com]
on behalf of hagen [xxxxx@dynax.at]
Sent: Saturday, June 18, 2011 5:56 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] PCIe device cannot start (Code 10) on Windows 7

your PCI BAR4 has the “prefetch bit” set. But the window is probably
disabled, since all other bits are zero, which means your device does
not allow the upper bits to be set from the PCI side. Thats valid
according to the PCI specification but not according to Bill.
The IO manager of Windows 7 will not load a KMDF driver for such a
device. It will though load a bare-WDM driver.

If you put your device in a checked build of Windows 7 it will crash
when starting its PCI.sys. Sometimes you will see a BSOD, other times
nothing, a hang or a reboot, depending on the weather.

If you can change your firmware (i.e. you don’t have any devices
released yet) you should enable this Windows (if you don’t need it,
set it to 4k). If you already released a device then your users are
doomed, as you cannot update your firmware, if Windows rejects the
driver.

This issue has been lengthy discussed on this list, what not means
that there are any solutions (yet).

Best regards,
Hagen.

On Sat, Jun 18, 2011 at 1:36 PM,? wrote:
>> Doron,and I forget to tell you one result that I test.
>> The chip that I used have two pin that control PCIe 32 BAR Window Size.
>> One is for BAR2,another is BAR4.
>> When these two pins are set to 1,BAR2 is 16MB size,BAR4 is 256MB size.
>> When these two pins are set to 0,the size of BAR2 and BAR4 is 0.
>>
>> I want to support 10 devices,so when BAR4 is set 256MB.
>> System space(2GB) exhaust.
>>
>> When the two pins is set to 1,driver works fine on windows
>> vista/2008/windows 7.
>> When I change either one of the two pin to 0,device failed to start on Win
>> 7.
>>
>> So this came a contradiction
>> if ?BAR4 is set 256MB,system space problem.
>> if ?BAR4 is set to 0,device failed to start on Win 7.
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

>When these two pins are set to 1,BAR2 is 16MB size,BAR4 is 256MB size.

When these two pins are set to 0,the size of BAR2 and BAR4 is 0.

I want to support 10 devices,so when BAR4 is set 256MB.
System space(2GB) exhaust.

When the two pins is set to 1,driver works fine on windows vista/2008/windows 7.
When I change either one of the two pin to 0,device failed to start on Win 7.

So this came a contradiction
if BAR4 is set 256MB,system space problem.
if BAR4 is set to 0,device failed to start on Win 7.

Our PCIe device’s uboot program can set up PCI BAR 4 size again.
So I want to set the two pins to 1,then install our driver,then start our device,
set up PCI BAR 4 size to 64MB in uboot program.
And I found when I write “0xFFFFFFFF” to the configuration space to test BAR 4 size,
it returns “FC000008”,it looks like the size of our device’s BAR 4 changed to 64MB.
But I found in device manager,our device’s BAR 4 is also 256MB.

I

It seems that system does not return the “256M-64M” device.
Just because PC BIOS start before uboot?
BAR 4 size is determined by PC BIOS,and can not be changed after PC BIOS started??

3ks.