Thanks.
(1) The interrupt is caused by not adding "ddi_intr_disable()"
    in detach() routine before removing interrupt handler.
(2) The problem is caused by driver "sd" has been removed on my
    step #1. I need to add it back.


Steve
 

-----Original Message-----
From: Javen Wu [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 07, 2008 6:24 AM
To: Steve Chang
Cc: driver-discuss@opensolaris.org
Subject: Re: [driver-discuss] SCSI HBA device driver unload question?

Steve Chang wrote:

>Here still has some questions
>1. As you said, run "rem_drv sd" and then run "rem_drv mydriver"
>   I did get "detach()" call. Every thing looks OK to release all
>   resources but later after "Fini()" is called and done, system hang.
>   Through traces, the kernel still dispatch interrupt to driver but 
>   at this moment, all driver's resources have been removed already. 
>   Does it mean my driver still missing handling something?  
>
>  
>
You driver should remove interrupt in your detach() routine since you 
add interrupt in your attach() routine.

>2. Another thing is after removing the driver not successful, reboot 
>   the system and reload the driver "add_drv ..". Now driver can be 
>   loaded but disks can’t be detected. The kernel only send cmd "0x12"
>   to detect hard disk and no more other commands. What happens to 
>   kernel? Is there any easy to let kernel back on normal besides
>   reinstall the original kernel file?
>  
>
I don't think kernel has any problem. You should trace/debug why your 
0x12 INQUIRY failed.
Actually 0x12 INQUIRY was issued by probe() routine like sdprobe(). If 
probe() failed, no more command would send to device.
So the way to solve problem is not to reinstall system or suspect kernel 
problem. I believe the problem exist in your driver.
Again, please trace/debug why INQUIRY(0x12) send to existing target 
cannot be returned successfully.

-javen

>Thanks
>Steve  
>
> 
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
>Sent: Monday, May 05, 2008 5:23 AM
>To: Steve Chang
>Cc: [EMAIL PROTECTED]; driver-discuss@opensolaris.org
>Subject: Re: [driver-discuss] SCSI HBA device driver unload question?
>
>If you want to unload your hba driver, you should make
>sure your hba device has no child in the device tree via
>"prtconf -D"
>
>And if there are some sd instance under your hba, you
>can try "rem_drv sd" to unload the sd driver firstly, and
>then unload your hba driver.  But before you unload sd
>driver, please make sure your boot system is not a SCSI
>disk, that means it is not drived by sd driver.
>
>Thanks,
>Ada
>
>Steve Chang wrote:
>  
>
>>Hello,
>>Here is another question about driver unload.
>>I've tried to unload the driver by "rem_drv mydriver"
>>but it always reports "Device Busy" and if do it one more
>>time, it said driver is removed but you need to reboot
>>the system to take effect. From debugging trace, I didn't
>>see "detach" routine is called?
>>
>>At this moment, there is no I/O activity but HBA firmware
>>naturally will keep interrupting HBA for service even it is
>>a null interrupt. In this case, how to handle that so my driver
>>can stop the interrupt first, then remove system resources
>>when users want to remove the driver.
>>
>>
>>Thanks
>>Steve
>>  
>>
>>_______________________________________________
>>driver-discuss mailing list
>>driver-discuss@opensolaris.org
>>http://mail.opensolaris.org/mailman/listinfo/driver-discuss
>>  
>>    
>>
>
>_______________________________________________
>driver-discuss mailing list
>driver-discuss@opensolaris.org
>http://mail.opensolaris.org/mailman/listinfo/driver-discuss
>
>  
>

_______________________________________________
driver-discuss mailing list
driver-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to