All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Pratyush Anand <pratyush.anand@gmail.com>,
	linux-pci@vger.kernel.org,
	Gary Bisson <gary.bisson@boundarydevices.com>,
	kernel@pengutronix.de, patchwork-lst@pengutronix.de
Subject: Re: [PATCH resend] PCI: designware: fix register access before host init
Date: Fri, 21 Oct 2016 10:31:42 -0500	[thread overview]
Message-ID: <20161021153142.GB9007@localhost> (raw)
In-Reply-To: <20161018082549.10905-1-l.stach@pengutronix.de>

On Tue, Oct 18, 2016 at 10:25:49AM +0200, Lucas Stach wrote:
> The function used to determine if iATU unroll is available will read
> a RC register. This is not possible and will result in a system hang
> if the RC is still in reset, so it is only safe to call this function
> after host_init() has been called.

I'm sure Joao tested a0601a470537 somewhere, so I assume this hang only
happens on certain systems?

I'm wondering if this is suggesting something that's currently done
differently across the drivers but could be done more similarly.

> Fixes: a0601a470537 (PCI: designware: Add iATU Unroll feature)
> Reported-by: Gary Bisson <gary.bisson@boundarydevices.com>
> Tested-by: Gary Bisson <gary.bisson@boundarydevices.com>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/pci/host/pcie-designware.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
> index 035f50c03281..74510508fafc 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -637,11 +637,11 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  		}
>  	}
>  
> -	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> -
>  	if (pp->ops->host_init)
>  		pp->ops->host_init(pp);
>  
> +	pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
> +
>  	pp->root_bus_nr = pp->busn->start;
>  	if (IS_ENABLED(CONFIG_PCI_MSI)) {
>  		bus = pci_scan_root_bus_msi(pp->dev, pp->root_bus_nr,
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-10-21 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18  8:25 [PATCH resend] PCI: designware: fix register access before host init Lucas Stach
2016-10-18 16:30 ` Jingoo Han
2016-10-18 18:36 ` Fabio Estevam
2016-10-21 15:31 ` Bjorn Helgaas [this message]
2016-10-21 16:22   ` Bjorn Helgaas
2016-10-21 16:44     ` João Pinto

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=20161021153142.GB9007@localhost \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=gary.bisson@boundarydevices.com \
    --cc=jingoohan1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-pci@vger.kernel.org \
    --cc=patchwork-lst@pengutronix.de \
    --cc=pratyush.anand@gmail.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.