Re: scsi_forget_host() and scsi_remove_device()

Christoph Hellwig
2003-07-06T15:59:16Z

On Thu, Jul 03, 2003 at 03:19:40PM -0700, Mike Anderson wrote:
> Yes, this is an issue. I became more of issue one we started using the
> LDM driver probe / remove functions.
>
> I am still cleaning up a patch set for hosts and devices so it is not
> quite ready for review yet (I got pulled off on to some other issues for
> a few days).
>
> For scsi devices here is a quick snap shot of what I trying to test.
> scsi_device_register:
> calls device_initialize on sdev_driverfs_dev
> calls class_device_initialize on sdev_classdev
> calls device_add on sdev_driverfs_dev
> calls class_device_add on sdev_classdev
> calls get_device on sdev_driverfs_dev
>
> scsi_device_unregister:
> sets a state the scsi_device indicating "delete"
> calls class_device_unregister on sdev_classdev
>
> scsi_device_cls_release:
> calls put_device on sdev_driverfs_dev

Hmm, where calling the put_device in the class device release func?

To be honest I'm everything but happy with the class_device / device
double-refcounting but it looks we can work around core issues in
scsi :P