linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: "David Müller" <dave.mueller@gmx.ch>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"Richard Zhu" <Richard.Zhu@freescale.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: imx6: Fix "BUG: scheduling while atomic" if PCIe switch is attached
Date: Mon, 22 Jun 2015 15:37:21 +0200	[thread overview]
Message-ID: <1434980241.3014.16.camel@pengutronix.de> (raw)
In-Reply-To: <CAOMZO5BLQXKwVjykQVVmD1kHHm=M31RJPmgGa1Tznz8gpYwvyw@mail.gmail.com>

Am Montag, den 22.06.2015, 10:30 -0300 schrieb Fabio Estevam:
> On Thu, Jun 18, 2015 at 5:27 AM, Lucas Stach <l.stach@pengutronix.de> wrote:
> 
> >> 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);
> >
> > While switching to mdelay might be the right thing to do here, you are
> > also changing the timeout. This is a change in behavior and so not okay.
> 
> msleep(2) is not recommended according to Documentation/timers/timers-howto.txt.
> 
> What would be the proper fix then?
> 
mdelay(2) is completely reasonable. Note the difference between delay
and sleep.

The mid-term correct solution would be to move all the link-up handling
out of the atomic path.

Regards,
Lucas
-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in

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

Thread overview: 7+ 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  8:27 ` Lucas Stach
2015-06-22 13:30   ` Fabio Estevam
2015-06-22 13:37     ` Lucas Stach [this message]
2015-06-22 13:46       ` Fabio Estevam
2015-06-18 13:21 ` 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=1434980241.3014.16.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=Richard.Zhu@freescale.com \
    --cc=bhelgaas@google.com \
    --cc=dave.mueller@gmx.ch \
    --cc=festevam@gmail.com \
    --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 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).