Re: [PATCH 2/2] pci: reserve extra bus resource for hotplug bridge

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

 



On Tue, Jul 3, 2012 at 8:16 PM, Taku Izumi <izumi.taku@xxxxxxxxxxxxxx> wrote:
>
> Currently I/O ports and I/O memory resources are reserved for
> hotplug bridges and we can tune their size by using hpiosize
> and hpmemsize boot option.
>
> This patch extends feature so that we can reserve additional
> bus number resources for hotplug bridges and tune it by
> using "hpbussize" option.
>
> Signed-off-by: Taku Izumi <izumi.taku@xxxxxxxxxxxxxx>
> ---
>  Documentation/kernel-parameters.txt |    4 ++++
>  drivers/pci/pci.c                   |    6 +++++-
>  drivers/pci/probe.c                 |    4 ++++
>  include/linux/pci.h                 |    1 +
>  4 files changed, 14 insertions(+), 1 deletion(-)
>
> Index: linux/drivers/pci/pci.c
> ===================================================================
> --- linux.orig/drivers/pci/pci.c        2012-06-26 14:37:22.000000000 +0900
> +++ linux/drivers/pci/pci.c     2012-07-04 10:00:50.708002757 +0900
> @@ -74,9 +74,11 @@ unsigned long pci_cardbus_mem_size = DEF
>
>  #define DEFAULT_HOTPLUG_IO_SIZE                (256)
>  #define DEFAULT_HOTPLUG_MEM_SIZE       (2*1024*1024)
> -/* pci=hpmemsize=nnM,hpiosize=nn can override this */
> +#define DEFAULT_HOTPLUG_BUS_SIZE       (0)
> +/* pci=hpmemsize=nnM,hpiosize=nn,hpbussize=n can override this */
>  unsigned long pci_hotplug_io_size  = DEFAULT_HOTPLUG_IO_SIZE;
>  unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE;
> +unsigned int pci_hotplug_bus_size = DEFAULT_HOTPLUG_BUS_SIZE;
>
>  enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;
>
> @@ -4022,6 +4024,8 @@ static int __init pci_setup(char *str)
>                                 pci_hotplug_io_size = memparse(str + 9, &str);
>                         } else if (!strncmp(str, "hpmemsize=", 10)) {
>                                 pci_hotplug_mem_size = memparse(str + 10, &str);
> +                       } else if (!strncmp(str, "hpbussize=", 10)) {
> +                               pci_hotplug_bus_size = memparse(str + 10, &str);
>                         } else if (!strncmp(str, "pcie_bus_tune_off", 17)) {
>                                 pcie_bus_config = PCIE_BUS_TUNE_OFF;
>                         } else if (!strncmp(str, "pcie_bus_safe", 13)) {
> Index: linux/drivers/pci/probe.c
> ===================================================================
> --- linux.orig/drivers/pci/probe.c      2012-06-26 14:37:22.000000000 +0900
> +++ linux/drivers/pci/probe.c   2012-07-04 10:00:50.718002632 +0900
> @@ -867,6 +867,10 @@ int __devinit pci_scan_bridge(struct pci
>                 /*
>                  * Set the subordinate bus number to its real value.
>                  */
> +               if (dev->is_hotplug_bridge) {
> +                       if (max + pci_hotplug_bus_size < child->busn_res.end)
> +                               max += pci_hotplug_bus_size;
> +               }

again, that adding is not safe.

please drop this one now.

or you can prepare one against busn_alloc and I put new version in the
busn_alloc branch.

Thanks

Yinghai
--
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