From patchwork Wed Aug 23 04:56:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9916581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1AF460327 for ; Wed, 23 Aug 2017 04:57:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2CD328864 for ; Wed, 23 Aug 2017 04:57:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D708C28954; Wed, 23 Aug 2017 04:57:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B21728864 for ; Wed, 23 Aug 2017 04:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ab/YqDgJlalPxRNp90wbrD2MeI+ZUq22VjEwHyQbmyo=; b=ea1MPGNG0QrF7NIt8ZRwnJKjOa BlMTsz7P1TolZLNKGVEGt3Ysk3mMP4LjjehhjG+AOeO/rUrsVjrw01HP0On0GxZqGi7pazEqAff+h +J74ilCJkPUlgaRMImOB9hIuN5lqkfyOpO/+/7Lijrm49ls9BHzljSs21nLaXG/L6KZU39y71YaeD KpkzjNCSsklEcKG9EsL2qE+Stdgu7iZuUUOOO3ifYyIn4/eSAZ+PBrE0A3S6hhAG/kV4E0jRKkwp9 uovniF3ZI7LHdSp/Hp/uFSsy9j4irgkhKyEubo1hTQKZglvJUXcPj+g0GVVZE2tO4IaI7TMrv9weq TyzVQSSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dkNjg-0003Qu-2z; Wed, 23 Aug 2017 04:57:48 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkNiX-0002I3-EZ for linux-arm-kernel@lists.infradead.org; Wed, 23 Aug 2017 04:56:42 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B82E360415; Wed, 23 Aug 2017 04:56:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503464181; bh=JQM9CWR6QUnkPdTtXqrc+jSkfOz/XPcx6pydBYpfI+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=es1wXNh6B3SAnjzfIsc1VrHRI89mDavbiW383uBZ4Ye5rs+kgtgWi/J9LpTl5nQfo 0nP43w7fTaqAMv5hjl/LP1301f84xIaCqAcEg4kG+XeCJrcPXf+bTVhicTjrnJW8uN 1s+ubrlly6Sg9oJvQEuZnHqnS+Tz6QWDUm4fQNbM= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 82EAB60722; Wed, 23 Aug 2017 04:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503464181; bh=JQM9CWR6QUnkPdTtXqrc+jSkfOz/XPcx6pydBYpfI+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=es1wXNh6B3SAnjzfIsc1VrHRI89mDavbiW383uBZ4Ye5rs+kgtgWi/J9LpTl5nQfo 0nP43w7fTaqAMv5hjl/LP1301f84xIaCqAcEg4kG+XeCJrcPXf+bTVhicTjrnJW8uN 1s+ubrlly6Sg9oJvQEuZnHqnS+Tz6QWDUm4fQNbM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 82EAB60722 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org, alex.williamson@redhat.com Subject: [PATCH V12 5/5] PCI: Warn periodically while waiting for device to become ready Date: Wed, 23 Aug 2017 00:56:11 -0400 Message-Id: <1503464171-6471-5-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503464171-6471-1-git-send-email-okaya@codeaurora.org> References: <1503464171-6471-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170822_215637_703128_C1BCED87 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sinan Kaya , linux-arm-msm@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add a print statement in pci_bus_wait_crs() so that user observes the progress of device polling instead of silently waiting for timeout to be reached. Signed-off-by: Sinan Kaya [bhelgaas: check for timeout first so we don't print "waiting, giving up", always print time we've slept (not the actual timeout, print a "ready" message if we've printed a "waiting" message] Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 93b89dd..4b30df7 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1841,11 +1841,16 @@ bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 l, int timeout) */ while ((l & 0xffff) == 0x0001) { if (delay > timeout) { - printk(KERN_WARNING "pci %04x:%02x:%02x.%d: not responding\n", - pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), - PCI_FUNC(devfn)); + pr_warn("pci %04x:%02x:%02x.%d: not ready after %dms; giving up\n", + pci_domain_nr(bus), bus->number, + PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1); + return false; } + if (delay >= 1000) + pr_info("pci %04x:%02x:%02x.%d: not ready after %dms; waiting\n", + pci_domain_nr(bus), bus->number, + PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1); msleep(delay); delay *= 2; @@ -1854,6 +1859,11 @@ bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 l, int timeout) return false; } + if (delay >= 1000) + pr_info("pci %04x:%02x:%02x.%d: ready after %dms\n", + pci_domain_nr(bus), bus->number, + PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1); + return true; }