From patchwork Wed Apr 30 01:00:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 4090011 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5CB199F271 for ; Wed, 30 Apr 2014 01:00:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FA1B2011E for ; Wed, 30 Apr 2014 01:00:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B99452021B for ; Wed, 30 Apr 2014 01:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755820AbaD3BAR (ORCPT ); Tue, 29 Apr 2014 21:00:17 -0400 Received: from mail-ig0-f179.google.com ([209.85.213.179]:39344 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755497AbaD3BAP (ORCPT ); Tue, 29 Apr 2014 21:00:15 -0400 Received: by mail-ig0-f179.google.com with SMTP id hl10so1103780igb.6 for ; Tue, 29 Apr 2014 18:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=v/hZfRiGFZnD/uYfTwLlvAOgckDDJsPM3oyc8T/BGxE=; b=IDhzDV1kv5jNdrylV9rDKks06Gj3/I4//zn8p3tTpE8SHrNApGN6uusK93QRgU3X/a 5bVvX3711FMGD8YlyfQ4N/tK3P/K5/GVS9o+abwFYD9AuSR4Kk+7gAZbd3wMWQtXUn6X 1YjgB1vWZTCp/aNzLNBK6g/cHWSqTrKXJksRg29jAkAZcMxaZ8aYYrz9S2T0IplGt+qr 7/sNQQ6gOAfxHXPQkKRo5vOB8pf3gGME+vQHfxD9FG07A/JeIM6a8Vb468ABdqOhWwPl wKDMVcV2i0JnRi38YnqPja24xnU9bOVyS0FEIDGYVaaM5upgnMSV0PevvxQ61etNQ69z rshw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=v/hZfRiGFZnD/uYfTwLlvAOgckDDJsPM3oyc8T/BGxE=; b=ieDqsH7BVEHi9Q7zS+ky16ogfpvSUFvRraIwG0DvaIE5LGuCit01u8rWHoHu+CSdmX 8gCHAiXOh7HDLc9tOes9p/Zx/fraxbSy8is7Tww5IA4kugguyUeamGepuKhzS/uBw0nw vrKvmj1rRt6qX7C+/OufjAiihmU2w5QnC8V9uzY6hbMSa/3Siixz11E+Iv46a/d03tIL 3LjZr5Ns/mzwP0FRQDUqSL/RhaFmdvnShIvrMTfN/L4gc/aYkNCej3mNb7357IDPauO2 pH11dzfTcfamPtVu466LGS51NTIQGDYVFfN15fbt/9hGTFaRjyvvTGld72arYVUF/psK zt6A== X-Gm-Message-State: ALoCoQlMWV88qSPYKKuXxpliHan+NRngOSDyOU9Lk0gp9su/Poh86ykzMJ8guLIkd2SHH1gAD9C3M7a7ftF0qMX7ceYD0ewZJTYoJKyqIaRFFnxBbfB4MjAd09KE1vJbGXgY45uKjsDrGPyj9t49hy1D+OaRyQSWVZoTM7YSUS+pVRYeV8PwgUOEfbW12NpJpsrqyZsmzK35LCcQp6vgVYDQf0ugM8+JCE8wZnBx9lP0cQtmVSKB8Hg= X-Received: by 10.50.44.115 with SMTP id d19mr34158358igm.1.1398819614196; Tue, 29 Apr 2014 18:00:14 -0700 (PDT) Received: from localhost ([172.16.51.53]) by mx.google.com with ESMTPSA id s8sm113399ige.4.2014.04.29.18.00.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 29 Apr 2014 18:00:13 -0700 (PDT) Subject: [PATCH 5/7] PCI: Don't print anything while decoding is disabled To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org Date: Tue, 29 Apr 2014 19:00:12 -0600 Message-ID: <20140430010012.13138.47492.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140430005642.13138.99577.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140430005642.13138.99577.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 the console is a PCI device, and we try to print to it while its decoding is disabled, the system will hang. This particular printk hasn't caused a problem yet, but it could, so this fixes it. See also 0ff9514b579b ("PCI: Don't print anything while decoding is disabled"). Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index dd710b12d34c..3bc149b848a8 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -174,7 +174,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, u64 l64, sz64, mask64; u16 orig_cmd; struct pci_bus_region region, inverted_region; - bool bar_too_big = false, bar_too_high = false; + bool bar_too_big = false, bar_too_high = false, bar_invalid = false; mask = type ? PCI_ROM_ADDRESS_MASK : ~0; @@ -289,11 +289,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, * be claimed by the device. */ if (inverted_region.start != region.start) { - dev_info(&dev->dev, "reg 0x%x: initial BAR value %pa invalid; forcing reassignment\n", - pos, ®ion.start); res->flags |= IORESOURCE_UNSET; - res->end -= res->start; res->start = 0; + res->end = region.end - region.start; + bar_invalid = true; } goto out; @@ -312,6 +311,9 @@ out: if (bar_too_high) dev_info(&dev->dev, "reg 0x%x: can't handle BAR above 4G (bus address %#010llx)\n", pos, (unsigned long long) l64); + if (bar_invalid) + dev_info(&dev->dev, "reg 0x%x: initial BAR value %#010llx invalid\n", + pos, (unsigned long long) region.start); if (res->flags) dev_printk(KERN_DEBUG, &dev->dev, "reg 0x%x: %pR\n", pos, res);