All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: "David Müller" <dave.mueller@gmx.ch>
Cc: linux-pci@vger.kernel.org,
	Richard Zhu <Richard.Zhu@freescale.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: imx6: Fix "BUG: scheduling while atomic" if PCIe switch is attached
Date: Thu, 18 Jun 2015 08:21:57 -0500	[thread overview]
Message-ID: <20150618132157.GB7710@google.com> (raw)
In-Reply-To: <1434614214-2085-1-git-send-email-dave.mueller@gmx.ch>

On Thu, Jun 18, 2015 at 09:56:54AM +0200, David Müller wrote:
> This problem has already been reported as 
> https://bugzilla.kernel.org/show_bug.cgi?id=100031
> 
> Signed-off-by: David Müller <dave.mueller@gmx.ch>
> ---
>  drivers/pci/host/pci-imx6.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
> index fdb9536..c63691c 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -489,7 +489,7 @@ static int imx6_pcie_link_up(struct pcie_port *pp)
>  		 * Wait a little bit, then re-check if the link finished
>  		 * the training.
>  		 */
> -		usleep_range(1000, 2000);
> +		mdelay(20);
>  	}
>  	/*
>  	 * From L0, initiate MAC entry to gen2 if EP/RC supports gen2.

I asked in the bugzilla why imx6_pcie_link_up() looks nothing like the
other pcie_host_ops.link_up() methods.

Lucas responded:
> the i.MX6 link up routine is a bit more complex compared to the other
> designware drivers because of a hardware bug, where some FIFOs could
> get out of sync when changing the link speed. We need to start the
> link at Gen1, wait for it to be stable, then start a directed link
> speed change if the EP is Gen2 and wait for the link to be stable
> again. If the link doesn't come back, we need to start over.

> I don't think any of the other DW PCIe implementations need this
> workaround.

That explanation makes sense, and a comment to that effect should be
in the code.  But I also wonder whether this workaround could be moved
to imx6_pcie_start_link() (just renamed to imx6_pcie_establish_link()).
Then imx6_pcie_link_up() could be a simple status check like the
others.

Bjorn

WARNING: multiple messages have this Message-ID (diff)
From: bhelgaas@google.com (Bjorn Helgaas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx6: Fix "BUG: scheduling while atomic" if PCIe switch is attached
Date: Thu, 18 Jun 2015 08:21:57 -0500	[thread overview]
Message-ID: <20150618132157.GB7710@google.com> (raw)
In-Reply-To: <1434614214-2085-1-git-send-email-dave.mueller@gmx.ch>

On Thu, Jun 18, 2015 at 09:56:54AM +0200, David M?ller wrote:
> This problem has already been reported as 
> https://bugzilla.kernel.org/show_bug.cgi?id=100031
> 
> Signed-off-by: David M?ller <dave.mueller@gmx.ch>
> ---
>  drivers/pci/host/pci-imx6.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
> index fdb9536..c63691c 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -489,7 +489,7 @@ static int imx6_pcie_link_up(struct pcie_port *pp)
>  		 * Wait a little bit, then re-check if the link finished
>  		 * the training.
>  		 */
> -		usleep_range(1000, 2000);
> +		mdelay(20);
>  	}
>  	/*
>  	 * From L0, initiate MAC entry to gen2 if EP/RC supports gen2.

I asked in the bugzilla why imx6_pcie_link_up() looks nothing like the
other pcie_host_ops.link_up() methods.

Lucas responded:
> the i.MX6 link up routine is a bit more complex compared to the other
> designware drivers because of a hardware bug, where some FIFOs could
> get out of sync when changing the link speed. We need to start the
> link at Gen1, wait for it to be stable, then start a directed link
> speed change if the EP is Gen2 and wait for the link to be stable
> again. If the link doesn't come back, we need to start over.

> I don't think any of the other DW PCIe implementations need this
> workaround.

That explanation makes sense, and a comment to that effect should be
in the code.  But I also wonder whether this workaround could be moved
to imx6_pcie_start_link() (just renamed to imx6_pcie_establish_link()).
Then imx6_pcie_link_up() could be a simple status check like the
others.

Bjorn

  parent reply	other threads:[~2015-06-18 13:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18  7:56 [PATCH] ARM: imx6: Fix "BUG: scheduling while atomic" if PCIe switch is attached David Müller
2015-06-18  7:56 ` David Müller
2015-06-18  8:27 ` Lucas Stach
2015-06-18  8:27   ` Lucas Stach
2015-06-22 13:30   ` Fabio Estevam
2015-06-22 13:30     ` Fabio Estevam
2015-06-22 13:37     ` Lucas Stach
2015-06-22 13:37       ` Lucas Stach
2015-06-22 13:46       ` Fabio Estevam
2015-06-22 13:46         ` Fabio Estevam
2015-06-18 13:21 ` Bjorn Helgaas [this message]
2015-06-18 13:21   ` Bjorn Helgaas
2015-07-14 18:33 ` Bjorn Helgaas
2015-07-14 18:33   ` 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=20150618132157.GB7710@google.com \
    --to=bhelgaas@google.com \
    --cc=Richard.Zhu@freescale.com \
    --cc=dave.mueller@gmx.ch \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.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 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.