From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753023AbdC0Jvy (ORCPT ); Mon, 27 Mar 2017 05:51:54 -0400 Received: from foss.arm.com ([217.140.101.70]:59336 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752760AbdC0Jul (ORCPT ); Mon, 27 Mar 2017 05:50:41 -0400 From: Lorenzo Pieralisi To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lorenzo Pieralisi , Arnd Bergmann , Will Deacon , Bjorn Helgaas , Russell King , Catalin Marinas , Pratyush Anand , Jingoo Han , Mingkai Hu , John Garry , Tanmay Inamdar , Murali Karicheri , Bharat Kumar Gogada , Ray Jui , Wenrui Li , Shawn Lin , Minghuan Lian , Jon Mason , Gabriele Paoloni , Thomas Petazzoni , Joao Pinto , Thierry Reding , Michal Simek , Stanimir Varbanov , Zhou Wang , Roy Zang , "Luis R. Rodriguez" Subject: [PATCH v2 03/22] asm-generic/pgtable.h: introduce pgprot_nonposted remap attribute Date: Mon, 27 Mar 2017 10:49:31 +0100 Message-Id: <20170327094954.7162-4-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170327094954.7162-1-lorenzo.pieralisi@arm.com> References: <20170327094954.7162-1-lorenzo.pieralisi@arm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to the PCI local bus specifications (Revision 3.0, 3.2.5), I/O Address space transactions are non-posted. On architectures where I/O space is implemented through a chunk of memory mapped space mapped to PCI address space (ie IA64/ARM/ARM64) the memory mapping for the region backing I/O Address Space transactions determines the I/O transactions attributes (before the transactions actually reaches the PCI bus where it is handled according to the PCI specifications). The kernel lacks a pgprot_* attribute to map memory with type generating non-posted writes transactions, which therefore needs to be added. Add a pgprot_nonposted mapping prot to create a memory mapping for memory areas requiring non-posted write transactions; make it default to pgprot_noncached (which should provide a sane default behaviour) but still allowing architectures on which pgprot_noncached results in posted write transactions to override the prot with an arch specific implementation that guarantees non-posted writes transactions. Signed-off-by: Lorenzo Pieralisi Cc: Arnd Bergmann Cc: Will Deacon Cc: Bjorn Helgaas Cc: Russell King Cc: Catalin Marinas --- include/asm-generic/pgtable.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 1fad160..2070172 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -399,6 +399,10 @@ static inline int pud_same(pud_t pud_a, pud_t pud_b) #define pgprot_device pgprot_noncached #endif +#ifndef pgprot_nonposted +#define pgprot_nonposted pgprot_noncached +#endif + #ifndef pgprot_modify #define pgprot_modify pgprot_modify static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) -- 2.10.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi) Date: Mon, 27 Mar 2017 10:49:31 +0100 Subject: [PATCH v2 03/22] asm-generic/pgtable.h: introduce pgprot_nonposted remap attribute In-Reply-To: <20170327094954.7162-1-lorenzo.pieralisi@arm.com> References: <20170327094954.7162-1-lorenzo.pieralisi@arm.com> Message-ID: <20170327094954.7162-4-lorenzo.pieralisi@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org According to the PCI local bus specifications (Revision 3.0, 3.2.5), I/O Address space transactions are non-posted. On architectures where I/O space is implemented through a chunk of memory mapped space mapped to PCI address space (ie IA64/ARM/ARM64) the memory mapping for the region backing I/O Address Space transactions determines the I/O transactions attributes (before the transactions actually reaches the PCI bus where it is handled according to the PCI specifications). The kernel lacks a pgprot_* attribute to map memory with type generating non-posted writes transactions, which therefore needs to be added. Add a pgprot_nonposted mapping prot to create a memory mapping for memory areas requiring non-posted write transactions; make it default to pgprot_noncached (which should provide a sane default behaviour) but still allowing architectures on which pgprot_noncached results in posted write transactions to override the prot with an arch specific implementation that guarantees non-posted writes transactions. Signed-off-by: Lorenzo Pieralisi Cc: Arnd Bergmann Cc: Will Deacon Cc: Bjorn Helgaas Cc: Russell King Cc: Catalin Marinas --- include/asm-generic/pgtable.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 1fad160..2070172 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -399,6 +399,10 @@ static inline int pud_same(pud_t pud_a, pud_t pud_b) #define pgprot_device pgprot_noncached #endif +#ifndef pgprot_nonposted +#define pgprot_nonposted pgprot_noncached +#endif + #ifndef pgprot_modify #define pgprot_modify pgprot_modify static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) -- 2.10.0