On 14-Mar-2010, at 6:23 PM, John Martin wrote:

> On 03/13/10 05:54 PM, Rick McNeal wrote:
>> 
>>> Probe being called before attach is expected behavior.
>>> 
>> 
>> True, I should have asked why is ddi_get_instance(dip) returning -1 on the 
>> 'sd' driver? I guessing there's something that I've done or not done with my 
>> driver, but what?
>> 
> 
> Does ddi_get_instance() return an expected value during
> attach?
> 

Let me step back here and reiterate. This panic is occurring in the 'sd' 
driver. The function xdfs_probe() is part of the 'sd' driver, not mine. sd 
first calls ddi_get_instance(dip) which returns -1. When xdfs_probe() then 
calls ddi_get_soft_state(xdfs_ssp, -1) the system panics.

This all occurs because my driver has attached to the system and I'm wondering 
what I've done or not done as the case may be.

> You normally call ddi_soft_state_init() in _init() and
> ddi_soft_state_zalloc() during attach().  So, calling
> ddi_get_soft_state(ddi_get_instance()) should be expected
> to fail during probe (return NULL) but probably not as spectacularly as
> it does for you when assertions are enabled.
> 

----
Rick McNeal
[email protected]

"It is not the critic who counts, not the man who points out how the strong man 
stumbled, or where the doer of deeds could have done them better. The credit 
belongs to the man who is actually in the arena; whose face is marred by dust 
and seat and blood; who strives valiantly, who errs and comes short again and 
again; who knows the great enthusiasms, the great devotions, and spends himself 
in a worthy cause; who, at the best, knows in the end the triumph of high 
achievement; and who, at the worst, if he fails, at least fails while daring 
greatly, so that his place shall never be with those cold and timid souls who 
know neither victory nor defeat." -- Theodore Roosevelt



_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to