Alexey Kardashevskiy wrote: [..] > >> but this is kinda wrong as it is quite bizarre to call > >> drivers/virt/coco/tsm-core.c's tsm_ide_stream_unregister() from > >> drivers/pci/ide.c's pci_ide_stream_release(), i.e. "virt" from "pci > >> core". imho the caller of pci_ide_stream_release() should just call > >> tsm_ide_stream_unregister() too, and so on. Thanks, > > > > So I agree it is odd, and I orginally did not have this tie until the > > DEFINE_FREE(pci_ide_stream_release, ...) proposal. With that I want to > > allow for TSM drivers to teardown everything associated with IDE setup > > with one scope-based-cleanup helper. > > > > It is not a mid-layer because nothing requires a TSM driver to call > > tsm_ide_stream_register(), but if they do register it then the PCI core > > helper will handle cleaning it up on error along with the rest of the > > resources. > > I see but imho DEFINE_FREE() is weak justification for such > cross-subsystem jumping, Interesting, I do not see 'struct pci_ide' understanding that one of the primary methods of establishing IDE (coordination through a TSM) as cross-subsystem jumping. It is unlikely that Linux will ever understand IDE establishment in any other form especially because, as far as I understand, all but Intel platforms enforce IDE establishment through TSM ABI calls. > still. I was looking at the linker error as, like, "find a Wally". not sure what that means... >May be then drop EXPORT_SYMBOL_GPL() for tsm_ide_stream_unregister()? True, that can be dropped now.