Re: [PATCH] pcie: Ensure hotplug ports have a minimum number of resources.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric W. Biederman wrote:
Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx> writes:

Eric W. Biederman wrote:
Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx> writes:

Eric W. Biederman wrote:
In general a BIOS may goof or we may hotplug in a hotplug controller.
In either case the kernel needs to reserve resources for plugging
in more devices in the future instead of creating a minimal resource
assignment.

I think we would need the same mechanism also for PCI bus number
assignment so that we can hot-plug devices containing bridges on
the leaf hot-plug slots.
Yep that would be handy.  I haven't had that case come up as a problem
yet.

(snip.)

 /**
  * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
  * @bus: pointer to PCI bus structure to search
@@ -2672,6 +2678,10 @@ static int __init pci_setup(char *str)
 							strlen(str + 19));
 			} else if (!strncmp(str, "ecrc=", 5)) {
 				pcie_ecrc_get_policy(str + 5);
+			} else if (!strncmp(str, "hpiosize=", 9)) {
+				pci_hotplug_io_size = memparse(str + 9, &str);
+			} else if (!strncmp(str, "hpmemsize=", 10)) {
+				pci_hotplug_mem_size = memparse(str + 10, &str);
 			} else {
 				printk(KERN_ERR "PCI: Unknown option `%s'\n",
 						str);
I think it would be better if we can specify the size per hotplug
controller driver or per slot or etc.
This happens too early to do anything per driver as this all happens
before the hotplug drivers load.  A per slot override seems reasonable
but I am starting with the simplest case an override of the default
allocation.
Do you need to override the resource assignments by firmware
at boot time?

That has come up.  Unfortunately the kernel didn't know that hardware
platform well enough to assign the resources correctly.  So I had to
go back in and fix the firmware.

I more commonly plug in pcie hotplug bridges into my pcie hotplug
bridges, and long before I can load a driver on them I need to assign
resources.


In addition to your requirement, I noticed another situation that
would require the resource assignment by PCI core. I guess it
would be required for hot-plugging PCI host bridge that contains
some PCIe hotplug slots.

Thanks,
Kenji Kaneshige


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux