Jeff Garzik wrote: > brking@xxxxxxxxxx wrote: >> Remove some of the dependence on the host_set struct >> in preparation for supporting SAS HBAs. Adds a struct device >> pointer to the ata_port struct. >> >> Signed-off-by: Brian King <brking@xxxxxxxxxx> > > Seems like a good idea independent of SAS. My only "objection" is > wondering about struct device reference counts, and wondering if we need > to worry about that. Did you look over the object lifetimes, to make > sure nothing overlaps? I don't see any object lifetime problems being introduced as a result of this patchset. I did spend some time looking through object lifetimes for SAS users (existing users should be unaffected by these changes) and I did have some problems in this regard in previous iterations of this patchset. (I did some SATA device hotplug testing with this patchset) The two rules that need to be followed by any new users of this patchset in order to not run into object lifetime problems are: 1. Prior to calling ata_sas_port_destroy, caller must guarantee that there are no outstanding references to the scsi_device. I accomplished this by calling ata_sas_port_destroy in target_destroy. 2. Before the pci_dev struct goes away (e.g. pci hotplug remove), all oustanding commands must be returned to libata and any new requests that come in through qc_issue should fail. This solves any lifetime issues that could have resulted from having the dev pointer for the PCI device in ata_port. I was thinking at one point that I would need to add reference counting to the ata_port, but was able to avoid that complexity with the solution above. -- Brian King eServer Storage I/O IBM Linux Technology Center - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html