Re: [PATCH v8 1/3] PCI: host: rcar: Add Renesas R-Car PCIe driver

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

 



Hi Phil,

Just a question...

On 12 May 2014 12:57, Phil Edworthy <phil.edworthy@xxxxxxxxxxx> wrote:
> This PCIe Host driver currently does not support MSI, so cards
> fall back to INTx interrupts.
>

> Signed-off-by: Phil Edworthy <phil.edworthy@xxxxxxxxxxx>
> ---
>  drivers/pci/host/Kconfig     |   6 +
>  drivers/pci/host/Makefile    |   1 +
>  drivers/pci/host/pcie-rcar.c | 768 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 775 insertions(+)
>  create mode 100644 drivers/pci/host/pcie-rcar.c
>
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> new file mode 100644
> index 0000000..3c524b9
> --- /dev/null
> +++ b/drivers/pci/host/pcie-rcar.c

> +static void rcar_pcie_enable(struct rcar_pcie *pcie)
> +{
> +       struct platform_device *pdev = to_platform_device(pcie->dev);
> +
> +       rcar_pci.nr_controllers = 1;
> +       rcar_pci.private_data = (void **)&pcie;
> +
> +       pci_common_init_dev(&pdev->dev, &rcar_pci);
> +#ifdef CONFIG_PCI_DOMAINS
> +       rcar_pci.domain++;
> +#endif
> +}
> +

How does it work when you have 2 PCIe DT node ?
(because for my point of view pci_common_init_dev() can't be called twice)

void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
{
    struct pci_sys_data *sys;
    LIST_HEAD(head);

    pci_add_flags(PCI_REASSIGN_ALL_RSRC);
    if (hw->preinit)
        hw->preinit();
    pcibios_init_hw(parent, hw, &head);
...

static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
                struct list_head *head)
{
    struct pci_sys_data *sys = NULL;
    int ret;
    int nr, busnr;

    for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
        sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
        if (!sys)
            panic("PCI: unable to allocate sys data!");

#ifdef CONFIG_PCI_DOMAINS
        sys->domain  = hw->domain;
#endif
        sys->busnr   = busnr;
...

the issue is that sys->busnr always starts to zero ...

how did you fix this problem?

Thanks.
Best Regards

Gabriel.
--
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