From patchwork Fri Sep 2 13:45:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 1121982 X-Patchwork-Delegate: bhelgaas@google.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p82DjnFc015426 for ; Fri, 2 Sep 2011 13:45:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056Ab1IBNpt (ORCPT ); Fri, 2 Sep 2011 09:45:49 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:37405 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836Ab1IBNps (ORCPT ); Fri, 2 Sep 2011 09:45:48 -0400 Received: by yxj19 with SMTP id 19so1151228yxj.19 for ; Fri, 02 Sep 2011 06:45:48 -0700 (PDT) Received: by 10.150.61.12 with SMTP id j12mr1043962yba.22.1314971148193; Fri, 02 Sep 2011 06:45:48 -0700 (PDT) Received: from scylla (cpe-70-113-48-102.austin.res.rr.com [70.113.48.102]) by mx.google.com with ESMTPS id f14sm1905607ani.15.2011.09.02.06.45.45 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Sep 2011 06:45:47 -0700 (PDT) Received: by scylla (sSMTP sendmail emulation); Fri, 2 Sep 2011 08:45:45 -0500 From: Jon Mason To: Jesse Barnes Cc: linux-pci@vger.kernel.org Subject: [PATCH] PCI: Remove MRRS modification from MPS setting code Date: Fri, 2 Sep 2011 08:45:45 -0500 Message-Id: <1314971145-28038-1-git-send-email-mason@myri.com> X-Mailer: git-send-email 1.7.6 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 02 Sep 2011 13:45:50 +0000 (UTC) Modifying the Maximum Read Request Size to 0 (value of 128Bytes) has massive negative ramifications on some devices. Without knowing which devices have this issue, do not modify from the default value when walking the PCI-E bus. Tested-by: Stephen M. Cameron Reported-and-tested-by: Eric Dumazet Reported-and-tested-by: Niels Ole Salscheider References: https://bugzilla.kernel.org/show_bug.cgi?id=42162 Signed-off-by: Jon Mason --- drivers/pci/probe.c | 36 ------------------------------------ 1 files changed, 0 insertions(+), 36 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 8473727..d896c5e 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1394,41 +1394,6 @@ static void pcie_write_mps(struct pci_dev *dev, int mps) dev_err(&dev->dev, "Failed attempting to set the MPS\n"); } -static void pcie_write_mrrs(struct pci_dev *dev, int mps) -{ - int rc, mrrs; - - if (pcie_bus_config == PCIE_BUS_PERFORMANCE) { - int dev_mpss = 128 << dev->pcie_mpss; - - /* For Max performance, the MRRS must be set to the largest - * supported value. However, it cannot be configured larger - * than the MPS the device or the bus can support. This assumes - * that the largest MRRS available on the device cannot be - * smaller than the device MPSS. - */ - mrrs = mps < dev_mpss ? mps : dev_mpss; - } else - /* In the "safe" case, configure the MRRS for fairness on the - * bus by making all devices have the same size - */ - mrrs = mps; - - - /* MRRS is a R/W register. Invalid values can be written, but a - * subsiquent read will verify if the value is acceptable or not. - * If the MRRS value provided is not acceptable (e.g., too large), - * shrink the value until it is acceptable to the HW. - */ - while (mrrs != pcie_get_readrq(dev) && mrrs >= 128) { - rc = pcie_set_readrq(dev, mrrs); - if (rc) - dev_err(&dev->dev, "Failed attempting to set the MRRS\n"); - - mrrs /= 2; - } -} - static int pcie_bus_configure_set(struct pci_dev *dev, void *data) { int mps = 128 << *(u8 *)data; @@ -1440,7 +1405,6 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data) pcie_get_mps(dev), 128<pcie_mpss, pcie_get_readrq(dev)); pcie_write_mps(dev, mps); - pcie_write_mrrs(dev, mps); dev_info(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n", pcie_get_mps(dev), 128<pcie_mpss, pcie_get_readrq(dev));