LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rojhalat Ibrahim <imr@rtschenk.de>
To: linuxppc-dev@lists.ozlabs.org
Cc: Yuanquan Chen <Yuanquan.Chen@freescale.com>, r61911@freescale.com
Subject: Re: [PATCH] powerpc/pci: fix PCI-e check link issue
Date: Tue, 21 May 2013 14:07:52 +0200	[thread overview]
Message-ID: <1405132.q7TVHIgXSr@pcimr> (raw)
In-Reply-To: <1368776129-21249-1-git-send-email-Yuanquan.Chen@freescale.com>

On Friday 17 May 2013 15:35:29 Yuanquan Chen wrote:
> For Freescale powerpc platform, the PCI-e bus number uses the reassign mode
> by default. It means the second PCI-e controller's hose->first_busno is the
> first controller's last bus number adding 1. For some hotpluged device(or
> controlled by FPGA), the device is linked to PCI-e slot at linux runtime.
> It needs rescan for the system to add it and driver it to work. It successes
> to rescan the device linked to the first PCI-e controller's slot, but fails
> to rescan the device linked to the second PCI-e controller's slot. The
> cause is that the bus->number is reset to 0, which isn't equal to the
> hose->first_busno for the second controller checking PCI-e link. So it
> doesn't really check the PCI-e link status, the link status is always
> no_link. The device won't be really rescaned. Reset the bus->number to
> hose->first_busno in the function fsl_pcie_check_link(), it will do the
> real checking PCI-e link status for the second controller, the device will
> be rescaned.
> 
> Signed-off-by: Yuanquan Chen <Yuanquan.Chen@freescale.com>

Tested-by: Rojhalat Ibrahim <imr@rtschenk.de>


> ---
>  arch/powerpc/sysdev/fsl_pci.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
> index 028ac1f..534597a 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -64,7 +64,7 @@ static int fsl_pcie_check_link(struct pci_controller
> *hose) if (hose->indirect_type & PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK) {
>  		if (hose->ops->read == fsl_indirect_read_config) {
>  			struct pci_bus bus;
> -			bus.number = 0;
> +			bus.number = hose->first_busno;
>  			bus.sysdata = hose;
>  			bus.ops = hose->ops;
>  			indirect_read_config(&bus, 0, PCIE_LTSSM, 4, &val);

      reply	other threads:[~2013-05-21 12:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  7:35 [PATCH] powerpc/pci: fix PCI-e check link issue Yuanquan Chen
2013-05-21 12:07 ` Rojhalat Ibrahim [this message]

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=1405132.q7TVHIgXSr@pcimr \
    --to=imr@rtschenk.de \
    --cc=Yuanquan.Chen@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=r61911@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox