Re: [PATCH] pci: generic host: make it more generic

From: Bjorn Helgaas
Date: Wed Nov 12 2014 - 22:59:37 EST


On Wed, Nov 12, 2014 at 1:58 AM, Ming Lei <ming.lei@xxxxxxxxxxxxx> wrote:
> On Wed, Nov 12, 2014 at 10:47 AM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote:
>> On Tue, Nov 11, 2014 at 7:12 PM, Ming Lei <ming.lei@xxxxxxxxxxxxx> wrote:
>>> ...
>>> Do you think it is doable to introduce a option(from module
>>> parameter, or device tree, ...) to let the driver and PCI core
>>> ignore/bypass all pcibios handling for the generic bus?
>>
>> No, I don't think so.
>
> Could you explain a bit? In VM world, it might be reasonable to
> claim that there is no pcibios service or pcibios service needn't.
>
> IMO it isn't easy to make a cross-arch PCI generic controller
> driver if pcibios handling has to be involved.

I'm not going to add kernel or module parameters to change the way the
basic code works. We need a way to factor the differences so the PCI
core code is the same for all arches, and the differences are hidden
in the arch-specific code.

That's basically what the pcibios interfaces do. I suspect they were
originally named "pcibios" because there's a "PCI BIOS" spec that
tells you how to make BIOS calls to enumerate devices, access config
space, manage interrupts, etc. But "pcibios" is now just the name of
interfaces to arch-specific functionality. Most arches don't have a
BIOS, and most pcibios_*() functions don't make BIOS calls.

If you have a new arch that has no "pcibios service" (I don't know
exactly what you mean by that), you can still implement the
pcibios_*() interfaces used by the PCI core. If some of these
interfaces don't actually do anything on your arch, that's fine; they
can be no-ops.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/