Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755843AbbETVCu (ORCPT ); Wed, 20 May 2015 17:02:50 -0400 Received: from mail-ig0-f173.google.com ([209.85.213.173]:38347 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754328AbbETVCo (ORCPT ); Wed, 20 May 2015 17:02:44 -0400 Date: Wed, 20 May 2015 16:02:34 -0500 From: Bjorn Helgaas To: "Luis R. Rodriguez" Cc: mst@redhat.com, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, linux-fbdev@vger.kernel.org, luto@amacapital.net, cocci@systeme.lip6.fr, "Luis R. Rodriguez" , Toshi Kani , Suresh Siddha , Ingo Molnar , Thomas Gleixner , Juergen Gross , Daniel Vetter , Dave Airlie , Antonino Daplas , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Mel Gorman , Vlastimil Babka , Borislav Petkov , Davidlohr Bueso , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/4] pci: add pci_ioremap_wc_bar() Message-ID: <20150520210234.GD32152@google.com> References: <1429647634-17169-1-git-send-email-mcgrof@do-not-panic.com> <1429647634-17169-2-git-send-email-mcgrof@do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1429647634-17169-2-git-send-email-mcgrof@do-not-panic.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3154 Lines: 86 On Tue, Apr 21, 2015 at 01:20:31PM -0700, Luis R. Rodriguez wrote: > From: "Luis R. Rodriguez" > > This lets drivers take advantage of PAT when available. This > should help with the transition of converting video drivers over > to ioremap_wc() to help with the goal of eventually using > _PAGE_CACHE_UC over _PAGE_CACHE_UC_MINUS on x86 on > ioremap_nocache() (de33c442e titled "x86 PAT: fix performance > drop for glx, use UC minus for ioremap(), ioremap_nocache() and > pci_mmap_page_range()") > > Cc: Toshi Kani > Cc: Bjorn Helgaas > Cc: Suresh Siddha > Cc: Ingo Molnar > Cc: Thomas Gleixner > Cc: Juergen Gross > Cc: Daniel Vetter > Cc: Andy Lutomirski > Cc: Dave Airlie > Cc: Antonino Daplas > Cc: Jean-Christophe Plagniol-Villard > Cc: Tomi Valkeinen > Cc: Ville Syrj?l? > Cc: Mel Gorman > Cc: Vlastimil Babka > Cc: Borislav Petkov > Cc: Davidlohr Bueso > Cc: linux-fbdev@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Luis R. Rodriguez I don't have any objection to this, and I can apply the follow-on patches as well, given the appropriate acks and prerequisite patches (ioremap_wc() implementation). > --- > drivers/pci/pci.c | 14 ++++++++++++++ > include/linux/pci.h | 1 + > 2 files changed, 15 insertions(+) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 687af72..fd14f10 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -138,6 +138,20 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) > return ioremap_nocache(res->start, resource_size(res)); > } > EXPORT_SYMBOL_GPL(pci_ioremap_bar); > + > +void __iomem *pci_ioremap_wc_bar(struct pci_dev *pdev, int bar) > +{ > + /* > + * Make sure the BAR is actually a memory resource, not an IO resource > + */ > + if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) { > + WARN_ON(1); > + return NULL; > + } > + return ioremap_wc(pci_resource_start(pdev, bar), > + pci_resource_len(pdev, bar)); > +} > +EXPORT_SYMBOL_GPL(pci_ioremap_wc_bar); > #endif > > #define PCI_FIND_CAP_TTL 48 > diff --git a/include/linux/pci.h b/include/linux/pci.h > index bc50bb0..490ca41 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -1667,6 +1667,7 @@ static inline void pci_mmcfg_late_init(void) { } > int pci_ext_cfg_avail(void); > > void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); > +void __iomem *pci_ioremap_wc_bar(struct pci_dev *pdev, int bar); > > #ifdef CONFIG_PCI_IOV > int pci_iov_virtfn_bus(struct pci_dev *dev, int id); > -- > 2.3.2.209.gd67f9d5.dirty > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/