All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Po Liu <po.liu@nxp.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	"Roy Zang" <roy.zang@nxp.com>, "Arnd Bergmann" <arnd@arndb.de>,
	linux-pci@vger.kernel.org,
	"Pratyush Anand" <pratyush.anand@gmail.com>,
	"Stuart Yoder" <stuart.yoder@nxp.com>,
	"Yang-Leo Li" <leoyang.li@nxp.com>,
	"Mingkai Hu" <mingkai.hu@nxp.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Ley Foon Tan" <lftan@altera.com>,
	"Michal Simek" <michal.simek@xilinx.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1] arm64:pci: fix the IOV device enabled crash issue in designware
Date: Wed, 24 Aug 2016 15:50:59 -0500	[thread overview]
Message-ID: <20160824205059.GG23914@localhost> (raw)
In-Reply-To: <1471932072-6980-1-git-send-email-po.liu@nxp.com>

[+cc Jingoo, Pratyush, Michal, S=F6ren, Ley]

On Tue, Aug 23, 2016 at 02:01:12PM +0800, 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.

What was the actual crash?  The mere fact that we made a config read fail
should not cause a crash.  We might erroneously prevent access to VF
devices, but it shouldn't crash.  So maybe there's another bug elsewhere
that we should fix first.

> The read/write config space from host would judge the pcie device plugin
> or not by:
> =

> if (bus->primary =3D=3D pp->root_bus_nr && dev > 0)
>     return 0;

I'm guessing other drivers have the same issue, e.g.,
altera_pcie_valid_config(), xilinx_pcie_valid_device().

Can you look through them and fix them all at once?

> Although all pcie devices for dev(coming from the device and function
> number) is zero. But the dev is not zero for VF. So remove the
> condition.
> =

> Signed-off-by: Po Liu <po.liu@nxp.com>
> ---
>  drivers/pci/host/pcie-designware.c | 7 -------
>  1 file changed, 7 deletions(-)
> =

> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-d=
esignware.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 =3D=3D 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 =3D=3D pp->root_bus_nr && dev > 0)
> -		return 0;
> -
>  	return 1;
>  }
>  =

> -- =

> 2.1.0.27.g96db324
> =

> =

> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: helgaas@kernel.org (Bjorn Helgaas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1] arm64:pci: fix the IOV device enabled crash issue in designware
Date: Wed, 24 Aug 2016 15:50:59 -0500	[thread overview]
Message-ID: <20160824205059.GG23914@localhost> (raw)
In-Reply-To: <1471932072-6980-1-git-send-email-po.liu@nxp.com>

[+cc Jingoo, Pratyush, Michal, S?ren, Ley]

On Tue, Aug 23, 2016 at 02:01:12PM +0800, 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.

What was the actual crash?  The mere fact that we made a config read fail
should not cause a crash.  We might erroneously prevent access to VF
devices, but it shouldn't crash.  So maybe there's another bug elsewhere
that we should fix first.

> The read/write config space from host would judge the pcie device plugin
> or not by:
> 
> if (bus->primary == pp->root_bus_nr && dev > 0)
>     return 0;

I'm guessing other drivers have the same issue, e.g.,
altera_pcie_valid_config(), xilinx_pcie_valid_device().

Can you look through them and fix them all at once?

> Although all pcie devices for dev(coming from the device and function
> number) is zero. But the dev is not zero for VF. So remove the
> condition.
> 
> Signed-off-by: Po Liu <po.liu@nxp.com>
> ---
>  drivers/pci/host/pcie-designware.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> 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;
>  }
>  
> -- 
> 2.1.0.27.g96db324
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2016-08-24 20:50 UTC|newest]

Thread overview: 26+ 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-23  6:01 ` Po Liu
2016-08-24 20:50 ` Bjorn Helgaas [this message]
2016-08-24 20:50   ` Bjorn Helgaas
2016-08-25  4:53   ` Po Liu
2016-08-25  4:53     ` Po Liu
2016-08-25 18:09     ` Bjorn Helgaas
2016-08-25 18:09       ` Bjorn Helgaas
2016-08-26  8:17       ` Po Liu
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-29  7:26   ` Po Liu
2016-08-30 15:43   ` Jingoo Han
2016-08-30 15:43     ` Jingoo Han
2016-08-30 15:54     ` Roy Zang
2016-08-30 15:54       ` Roy Zang
2016-08-30 16:32       ` Roy Zang
2016-08-30 16:32         ` Roy Zang
2016-08-30 18:15       ` Jingoo Han
2016-08-30 18:15         ` Jingoo Han
2016-08-30 18:25         ` Roy Zang
2016-08-30 18:25           ` Roy Zang
2016-09-01  0:58   ` Ley Foon Tan
2016-09-01  0:58     ` Ley Foon Tan
2016-09-12 21:44   ` Bjorn Helgaas
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=20160824205059.GG23914@localhost \
    --to=helgaas@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=jingoohan1@gmail.com \
    --cc=leoyang.li@nxp.com \
    --cc=lftan@altera.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=mingkai.hu@nxp.com \
    --cc=po.liu@nxp.com \
    --cc=pratyush.anand@gmail.com \
    --cc=roy.zang@nxp.com \
    --cc=soren.brinkmann@xilinx.com \
    --cc=stuart.yoder@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.