From patchwork Mon Jun 20 22:47:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 899052 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 p5KMlusk022342 for ; Mon, 20 Jun 2011 22:47:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756179Ab1FTWrz (ORCPT ); Mon, 20 Jun 2011 18:47:55 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:45787 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755338Ab1FTWrx (ORCPT ); Mon, 20 Jun 2011 18:47:53 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e8.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p5KMaJ5V021938; Mon, 20 Jun 2011 18:36:19 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5KMloqt451358; Mon, 20 Jun 2011 18:47:51 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5KMloPW004683; Mon, 20 Jun 2011 19:47:50 -0300 Received: from us.ibm.com ([9.49.212.64]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p5KMlkGP004141; Mon, 20 Jun 2011 19:47:46 -0300 Received: by us.ibm.com (sSMTP sendmail emulation); Mon, 20 Jun 2011 15:47:42 -0700 From: Ram Pai To: jbarnes@virtuousgeek.org Cc: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, svenkatr@ti.com, yinghai@kernel.org, cjb@laptop.org, linux-pci@vger.kernel.org, linux-net-drivers@solarflare.com, bhutchings@solarflare.com, Ram Pai Subject: [PATCH 3/4] PCI: make SRIOV resources nice-to-have Date: Mon, 20 Jun 2011 15:47:16 -0700 Message-Id: <1308610037-6261-4-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1308610037-6261-1-git-send-email-linuxram@us.ibm.com> References: <1308610037-6261-1-git-send-email-linuxram@us.ibm.com> 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]); Mon, 20 Jun 2011 22:47:57 +0000 (UTC) From: Yinghai Lu Allocate resources to SRIOV BARs only after all other genuine resources requests are satisfied. Dont retry if resource allocation for SRIOV BARs fail. Signed-off-by: Ram Pai Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index c282c48..4f8873e 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -672,6 +672,16 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, if (r->parent || (r->flags & mask) != type) continue; r_size = resource_size(r); +#ifdef CONFIG_PCI_IOV + /* add SRIOV BARs to nice-to-have list */ + if (add_head && i >= PCI_IOV_RESOURCES && + i <= PCI_IOV_RESOURCE_END) { + r->end = r->start - 1; + add_to_list(add_head, dev, r, r_size, 1); + children_add_size += r_size; + continue; + } +#endif /* For bridges size != alignment */ align = pci_resource_alignment(dev, r); order = __ffs(align) - 20;