From: jingoohan1@gmail.com (Jingoo Han)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm64:pci: fix the IOV device access config space valid condition
Date: Tue, 30 Aug 2016 11:43:25 -0400 [thread overview]
Message-ID: <000a01d202d5$3f86e3a0$be94aae0$@gmail.com> (raw)
In-Reply-To: <1472455618-17892-1-git-send-email-po.liu@nxp.com>
On Monday, August 29, 2016 3:27 AM, Po Liu wrote:
>
> When echo a number to /sys/bus/pci/devices/xxx/sriov_numvfs to enable the
> VF devices. A crash log occurred. This found to be access the IOV devices
> config space failure issue.
>
> The read/write config space from host would judge the pcie device plugin
> or not by(Designware platform as example):
>
> if (bus->primary == pp->root_bus_nr && dev > 0)
> return 0;
>
> Although all PCIe devices for dev(coming from the device and function
> number) is zero. But the dev is not zero for VF devices. So remove the
> condition.
>
> These PCI hosts were changed: designware, altera, xilinx.
>
> Signed-off-by: Po Liu <po.liu@nxp.com>
For 'pcie-designware.c',
Acked-by: Jingoo Han <jingoohan1@gmail.com>
I really don't like to modify host driver stuffs.
But, if there is no alternatives, this patch looks good.
Best regards,
Jingoo Han
> ---
> changes for v2:
> - add pci hosts: altera, xilinx;
>
> drivers/pci/host/pcie-altera.c | 7 -------
> drivers/pci/host/pcie-designware.c | 7 -------
> drivers/pci/host/pcie-xilinx.c | 7 -------
> 3 files changed, 21 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-
> altera.c index 2b78376..edbe0a7 100644
> --- a/drivers/pci/host/pcie-altera.c
> +++ b/drivers/pci/host/pcie-altera.c
> @@ -171,13 +171,6 @@ static bool altera_pcie_valid_config(struct
> altera_pcie *pcie,
> if (bus->number == pcie->root_bus_nr && dev > 0)
> return false;
>
> - /*
> - * Do not read more than one device on the bus directly attached
> - * to root port, root port can only attach to one downstream port.
> - */
> - if (bus->primary == pcie->root_bus_nr && dev > 0)
> - return false;
> -
> return true;
> }
>
> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-
> designware.c
> index 12afce1..dd20eb2 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -670,13 +670,6 @@ static int dw_pcie_valid_config(struct pcie_port *pp,
> if (bus->number == pp->root_bus_nr && dev > 0)
> return 0;
>
> - /*
> - * do not read more than one device on the bus directly attached
> - * to RC's (Virtual Bridge's) DS side.
> - */
> - if (bus->primary == pp->root_bus_nr && dev > 0)
> - return 0;
> -
> return 1;
> }
>
> diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-
> xilinx.c index a30e016..75c89db 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -168,13 +168,6 @@ static bool xilinx_pcie_valid_device(struct pci_bus
> *bus, unsigned int devfn)
> if (bus->number == port->root_busno && devfn > 0)
> return false;
>
> - /*
> - * Do not read more than one device on the bus directly attached
> - * to RC.
> - */
> - if (bus->primary == port->root_busno && devfn > 0)
> - return false;
> -
> return true;
> }
>
> --
> 2.1.0.27.g96db324
next prev parent reply other threads:[~2016-08-30 15:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 6:01 [PATCH v1] arm64:pci: fix the IOV device enabled crash issue in designware Po Liu
2016-08-24 20:50 ` Bjorn Helgaas
2016-08-25 4:53 ` Po Liu
2016-08-25 18:09 ` Bjorn Helgaas
2016-08-26 8:17 ` Po Liu
2016-08-29 7:26 ` [PATCH v2] arm64:pci: fix the IOV device access config space valid condition Po Liu
2016-08-30 15:43 ` Jingoo Han [this message]
2016-08-30 15:54 ` Roy Zang
2016-08-30 16:32 ` Roy Zang
2016-08-30 18:15 ` Jingoo Han
2016-08-30 18:25 ` Roy Zang
2016-09-01 0:58 ` Ley Foon Tan
2016-09-12 21:44 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000a01d202d5$3f86e3a0$be94aae0$@gmail.com' \
--to=jingoohan1@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).