From patchwork Mon Jul 9 18:20:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1174351 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6402CDFFAD for ; Mon, 9 Jul 2012 18:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752325Ab2GISUY (ORCPT ); Mon, 9 Jul 2012 14:20:24 -0400 Received: from mail-wi0-f202.google.com ([209.85.212.202]:60114 "EHLO mail-wi0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752517Ab2GISUU (ORCPT ); Mon, 9 Jul 2012 14:20:20 -0400 Received: by wibhr14 with SMTP id hr14so173510wib.1 for ; Mon, 09 Jul 2012 11:20:19 -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=GU/sA9auIRjmjkDzwxXGXJsjdqkTPX1zrSri26vNrFI=; b=mz4BqmB+e2OWHFKzuX4MhEKKp50bPpbFsP30k10/ICEXlZCtqXJDEKL8Q1DXrpiwCn t+KQUjLCxzcPMsN81QHWesBrGKp4CXMZetW/1YVInmt4k0PP9PGZLgMUzuzKqv4MQ5ca UQzfnHarp+DXwWqNHtvlxzSNiQuf2irgivqzgoixth2ErqUm6GsfsxFeyfHlU5bXDKbG rDb25Yb7PGTytTcDdQLRq5yK9Zni5hJRdTppjeurj+QUb5/7t4PXloAb6HqJgznzq6HP CEJ0aFEYKv4Dm8b9Xwq3IgzbaR0WTj9DznOwkT/hbiTlBioWqT+KjOPLbEeq7xi3O3XS Llhg== X-Google-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 :x-gm-message-state; bh=GU/sA9auIRjmjkDzwxXGXJsjdqkTPX1zrSri26vNrFI=; b=JaQFPP5PNi0cPee7NLd+RuRNffHD4nxzikUEzd/50mz52OPwW0Zmhtl/OLjR0tXpsg vk5HYa8hb+LVlKHlzvakBEotXgLoR53cZAGfoKaG66TXTJyS1n3glH3GV+VgbW8JyXO1 7jpXi//1QBx94fZ+i9Nek3/GFJ5pDD4qBKdEzNOQ0casZL4+pUB2RS2pvow9Itbc4vpU m66FSSGoqta427jt6K1SYRm3H/SKXTTnJIQDHzxmA2X5K/u+qckRJpG8JyLKZlmYsBYs Izw62GShylvVKs7X1mkR9bVqq1yJ/N8lhNFBOmbQJ5GMzwucuaELDb4r9E2mO+KdKCnA J0Xw== Received: by 10.14.98.134 with SMTP id v6mr13086842eef.2.1341858019091; Mon, 09 Jul 2012 11:20:19 -0700 (PDT) Received: by 10.14.98.134 with SMTP id v6mr13086827eef.2.1341858018957; Mon, 09 Jul 2012 11:20:18 -0700 (PDT) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id b16si22990492eeg.3.2012.07.09.11.20.18 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 09 Jul 2012 11:20:18 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.18.96.155]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id BDCAA5C0060; Mon, 9 Jul 2012 11:20:18 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 3164F180156; Mon, 9 Jul 2012 11:20:18 -0700 (PDT) Subject: [PATCH 1/2] PCI: leave MEM and IO decoding disabled during 64-bit BAR sizing, too To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Jacob Pan , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Jesse Barnes , Ivan Kokshaysky , Matthew Wilcox , Robert Hancock Date: Mon, 09 Jul 2012 12:20:18 -0600 Message-ID: <20120709182018.18165.98339.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20120709181745.18165.93914.stgit@bhelgaas.mtv.corp.google.com> References: <20120709181745.18165.93914.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnGxKAqMexDhUvkIKvSnz7m8RRae8zHMkpQhLorfmVmAfxBsh3zUTkotwR42N8pTEVfkfp4R4lWmWhbQVQQeiQAy01PNSIwJUP32dhI6mTsu2CEkneNsCi8GPT5iWbVhUBdHlXn4T4V9mDMuRveqziGvsy2Fz4Htgill22GLAyKEN7XsSQihaGdoaDDXKiDvKEWQP54 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org After 253d2e5498, we disable MEM and IO decoding for most devices while we size 32-bit BARs. However, we restore the original COMMAND register before we size the upper 32 bits of 64-bit BARs, so we can still cause a conflict. This patch waits to restore the original COMMAND register until we're completely finished sizing the BAR. Reference: https://lkml.org/lkml/2007/8/25/154 Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 6 +++--- 1 files changed, 3 insertions(+), 3 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 658ac97..66b3a6f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -152,9 +152,6 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, pci_read_config_dword(dev, pos, &sz); pci_write_config_dword(dev, pos, l); - if (!dev->mmio_always_on) - pci_write_config_word(dev, PCI_COMMAND, orig_cmd); - /* * All bits set in sz means the device isn't working properly. * If the BAR isn't implemented, all bits must be 0. If it's a @@ -239,6 +236,9 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, } out: + if (!dev->mmio_always_on) + pci_write_config_word(dev, PCI_COMMAND, orig_cmd); + return (res->flags & IORESOURCE_MEM_64) ? 1 : 0; fail: res->flags = 0;