[openib-general] svn patches.
Greg KH
Wed Apr 28 15:01:51 PDT 2004
On Wed, Apr 28, 2004 at 02:56:38PM -0700, Roland Dreier wrote:
> Greg> Hahaha, you all only support 2 devices? And it's either 1
> Greg> or the other? What about more than 1 controller in a system
> Greg> at the same time? What about PCI hotplug systems? This
> Greg> code is guaranteed to do very bad things to the system if
> Greg> someone removes the controller while the driver is still
> Greg> bound.
>
> Seems like you're looking at the SRP driver. That hack obviously
> needs to go away. Basically we need to add a method to the core HCA
> driver to return a pointer to the device so that ULPs can use it for
> DMA mapping and other stuff (like passing to scsi_set_pci_device).
The proper pci_register_driver() interface is what you need to do. That
works just fine for 2.4 and 2.6, and will handle all of the hotplug
issues properly.
> In fact that's one of the things that I'm trying to figure out how to
> do in a way portable between 2.4 and 2.6. For 2.6 we clearly want to
> just use a struct device * (since there are devices we care about on
> things like a PPC4xx EPB rather than PCI), but the device model and
> generic DMA mapping API doesn't exist on 2.4.
And it will not ever get backported either (for good reason, 2.4
development is over.) So, I was just lucky in finding the main reason
why 2.4 support is going to be almost impossible? :)
> Hotplug is an even bigger can of worms. I don't know what the heck we
> do for stuff like userspace processes that have registered memory with
> an HCA that is no longer attached to the system.
If you use pci_register_driver() everything will work just fine. The
driver has to tell userspace that it's resources are now gone just
before the card goes away, just like it happens if you unload the
module.
Also, why is the memory model backwards from the traditional Unix mmap
model? (kernel gives out the memory to the user, the user never gives a
memory chunk to the kernel.) Is there some IB reason for this that I'm
missing?
thanks,
greg k-h
--
To unsubscribe send an email with subject unsubscribe to openib-general at openib.org.
Please contact moderator at openib.org for questions.
More information about the openib-general mailing list