From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44B85C2D0DB for ; Thu, 30 Jan 2020 14:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 175CE206F0 for ; Thu, 30 Jan 2020 14:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbgA3Ojk (ORCPT ); Thu, 30 Jan 2020 09:39:40 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:52824 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbgA3Ojk (ORCPT ); Thu, 30 Jan 2020 09:39:40 -0500 Received: from 79.184.253.19.ipv4.supernova.orange.pl (79.184.253.19) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id 7a66a180fdbaa80f; Thu, 30 Jan 2020 15:39:38 +0100 From: "Rafael J. Wysocki" To: Sergei Miroshnichenko Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Stefan Roese , linux@yadro.com, "Rafael J . Wysocki" Subject: Re: [PATCH v7 20/26] PNP: Don't reserve BARs for PCI when enabled movable BARs Date: Thu, 30 Jan 2020 15:39:37 +0100 Message-ID: <47893157.JDNA6rlMKs@kreacher> In-Reply-To: <20200129152937.311162-21-s.miroshnichenko@yadro.com> References: <20200129152937.311162-1-s.miroshnichenko@yadro.com> <20200129152937.311162-21-s.miroshnichenko@yadro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wednesday, January 29, 2020 4:29:31 PM CET Sergei Miroshnichenko wrote: > When the Movable BARs feature is supported, the PCI subsystem is able to > distribute existing BARs and allocate the new ones itself, without need to > reserve gaps by BIOS. > > CC: Rafael J. Wysocki > Signed-off-by: Sergei Miroshnichenko > --- > drivers/pnp/system.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c > index 6950503741eb..16cd260a609d 100644 > --- a/drivers/pnp/system.c > +++ b/drivers/pnp/system.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -58,6 +59,11 @@ static void reserve_resources_of_dev(struct pnp_dev *dev) > struct resource *res; > int i; > > +#ifdef CONFIG_PCI > + if (pci_can_move_bars) > + return; > +#endif Would it be a problem to define pci_can_move_bars() as a static inline returning 'false' when CONFIG_PCI is unset? The #ifdef wouldn't be needed here then. > + > for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_IO, i)); i++) { > if (res->flags & IORESOURCE_DISABLED) > continue; >