From patchwork Sun Aug 27 17:40:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9923981 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 01583603B5 for ; Sun, 27 Aug 2017 17:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E14842863C for ; Sun, 27 Aug 2017 17:42:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D44C92863E; Sun, 27 Aug 2017 17:42:46 +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 57CFC2863C for ; Sun, 27 Aug 2017 17:42:46 +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=XdN4yAI0+mg0f5Mzy6vuW/dZYEiPSWozTkXN60ydfVI=; b=XZ8GasZNfNC8DMdh6WO/ngjobj NJ2B4kHErDfHEwJQEyPt5g6j0U6v+5+I5Psme7FmoaigF2/WOS8Xrk7jjCEnm1AxDMxHL5QuL7WhY 8HSj9w9j0/vzoC/JMJIEV+kht5UAJ1nJfCgWlxIhMbZo/laEe6/O6/vV7sL/eJFPWd2Q6P6L87t+Q 604kcJcciAaXl+z+RdhRS3OnhkcWW8mRmUpEevRdkxN7XpxxF6i9tTdcE6VSqmiHXXObyD9MNgu7u GrAduVeZ1zW8Kp6HqfiQxOzcxY65GxImM0wKehHnrUT773COMRy0Hjr1r6K0c9PJ4E/t1/GLgUTZr ZxEu59+g==; 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 1dm1a3-000301-Qf; Sun, 27 Aug 2017 17:42:39 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dm1Yo-0002HO-1i for linux-arm-kernel@lists.infradead.org; Sun, 27 Aug 2017 17:41:26 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1865960732; Sun, 27 Aug 2017 17:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503855665; bh=7Ls4blrPadPDB4bWVv2cWZXjwk72dzF3q4qikjgLOG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mRekhcTabj36fzVkq3NupEvGwr6oO0UpsxAAR/58IS60V/KINS5/+lE7ME494vL+3 WbEV+IB/iadC5qaNdjhiZlTIGrNSSArVs0QJ2xTh8ErZ2HzTERnxSi3o9xI66CbDXi Pm2tmvez4WYQ3ItTHrkhgZT7i4YJn8WJCSEPZKtc= 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 B1F1560732; Sun, 27 Aug 2017 17:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503855664; bh=7Ls4blrPadPDB4bWVv2cWZXjwk72dzF3q4qikjgLOG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwtBIkrTP0QZzMg6yyCvdKD6A1KiU+/wkBWJRKRnStqvh43MkSyLt9qa1NGSqYUcD ZQIOSqPNChZKSJ/gxaFEsgw8U3pXMcugQA5nVypPfloos0/DrRhHaGW7k8AI8Wv7Nl 5I1D6kMw4DQNHtsZ0nRi5EkR78CaCBl6mpWlZeZE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B1F1560732 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 V13 4/4] PCI: Warn periodically while waiting for device to become ready Date: Sun, 27 Aug 2017 13:40:51 -0400 Message-Id: <1503855651-17409-4-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503855651-17409-1-git-send-email-okaya@codeaurora.org> References: <1503855651-17409-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170827_104122_287378_8C62DCEB X-CRM114-Status: GOOD ( 10.41 ) 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 d834a20..8f7ba16 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1847,11 +1847,16 @@ static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 l, */ 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; @@ -1860,6 +1865,11 @@ static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 l, 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; }