DriverKit IOUserSCSIPeripheralDeviceType00: kernel panic when setPowerState exceeds 20 seconds

We have an IOUserSCSIPeripheralDeviceType00 class DEXT supporting USB attached devices. With some high-capacity drives, the default setPowerState can exceed 20s to complete. This triggers a kernel panic, although this drive behavior is not unexpected.

With a kernel extension implementing similar functionality we see no such problem as it appears from reading of Apple open source the timeout was 100s.

What changes will allow setPowerState to complete without the kernel panic?

kernel panic report excerpt attached.

Answered by DTS Engineer in 862392022

Have you filed a bug on this and, if so, what is the bug number?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Have you filed a bug on this and, if so, what is the bug number?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

SO, looking over the issue, I have two things to pass along:

  1. If you're dealing with these issues at Start() (which can cause the same general panic), then the solution is to return from Start() "immediately", but not call RegisterService() until you've completed all hardware setup and your hardware is ready to function. This has always been the approach we recommended, but I've seen this come up enough that I wanted to highlight it.

  2. In terms of SetPowerState(), I don't see any solution. The power team is aware of the issue, but the issue will require new DriverKit API to properly resolve. I'm afraid the only option is to wait for that to happen.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

DriverKit IOUserSCSIPeripheralDeviceType00: kernel panic when setPowerState exceeds 20 seconds
 
 
Q