From patchwork Mon Nov 9 10:48:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sharma, Sanjeev" X-Patchwork-Id: 7582361 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 81AA19F1AF for ; Mon, 9 Nov 2015 10:49:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55CC320680 for ; Mon, 9 Nov 2015 10:49:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65D5820673 for ; Mon, 9 Nov 2015 10:49:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752069AbbKIKtf (ORCPT ); Mon, 9 Nov 2015 05:49:35 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:39629 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbbKIKte (ORCPT ); Mon, 9 Nov 2015 05:49:34 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Zvjze-0004zU-R2 from sanjeevs@inn.mentorg.com ; Mon, 09 Nov 2015 02:48:11 -0800 Received: from inndt291.inn.mentorg.com (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 9 Nov 2015 10:48:09 +0000 Received: from inndt291.inn.mentorg.com (localhost [127.0.0.1]) by inndt291.inn.mentorg.com (8.14.5/8.14.5) with ESMTP id tA9Am6NT005898; Mon, 9 Nov 2015 16:18:07 +0530 Received: (from sanjeevs@localhost) by inndt291.inn.mentorg.com (8.14.5/8.14.5/Submit) id tA9Am3eM005896; Mon, 9 Nov 2015 16:18:03 +0530 From: Sanjeev Sharma To: , , CC: , , , Sanjeev Sharma , David Mueller Subject: [PATCH] PCI: imx6:don't sleep in atomic context Date: Mon, 9 Nov 2015 16:18:00 +0530 Message-ID: <1447066080-5859-1-git-send-email-sanjeev_sharma@mentor.com> X-Mailer: git-send-email 1.7.11.7 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If additional PCIe switch get connected between the host and the NIC,the kernel crashes with "BUG: scheduling while atomic". To handle this we need to call mdelay() instead of usleep_range(). For more detail please refer bugzilla.kernel.org, Bug 100031 Signed-off-by: Sanjeev Sharma Signed-off-by: David Mueller --- 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 233a196..9769b13 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -499,7 +499,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(1000); } /* * From L0, initiate MAC entry to gen2 if EP/RC supports gen2.