Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128AbbGNQ6b (ORCPT ); Tue, 14 Jul 2015 12:58:31 -0400 Received: from mail-bl2on0053.outbound.protection.outlook.com ([65.55.169.53]:64880 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751900AbbGNQ62 (ORCPT ); Tue, 14 Jul 2015 12:58:28 -0400 X-Greylist: delayed 2722 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Jul 2015 12:58:27 EDT Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; Message-ID: <55A53FAC.30103@caviumnetworks.com> Date: Tue, 14 Jul 2015 09:58:20 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Will Deacon CC: David Daney , "linux-arm-kernel@lists.infradead.org" , Catalin Marinas , "linux-kernel@vger.kernel.org" , Robert Richter , "David Daney" Subject: Re: [PATCH] arm64: Define HAVE_ARCH_PIO_SIZE and related symbols. References: <1436823096-24059-1-git-send-email-ddaney.cavm@gmail.com> <20150714110039.GC16213@arm.com> <55A53509.4060202@caviumnetworks.com> <20150714162955.GR16213@arm.com> In-Reply-To: <20150714162955.GR16213@arm.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: SN1PR07CA0041.namprd07.prod.outlook.com (25.162.170.179) To BLUPR0701MB1716.namprd07.prod.outlook.com (25.163.85.142) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1716;2:yomvo8TgOTG6b+9Q2Awcvx4zSnYSvrSGs2it9hT0jCIpJk3K96mij7+BPqjwBxZJ;3:MjBPKWVeYmPyqgD2TUPEsSdpSI8kAgyqjU77V9Zm8EvQopkP0aF7vKhUyucBUTDrP8btbGb+olZqa1ZFs2NB7aMcGPYSp1j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6t2a0vr7Gm7Y5Q+MZpOwGCVWUwOpq3Kv91J5kCzpHTl1z917v7zgXLfrbUiUicfzTdkEHAsrihjF+PiW7K0CgVZTddBZxnuz7wshxdODHvwiSN7mTC/n8VPMZ9l4Aj5y/6DVREr0jvReP+OrW6F4x+5BjlGFf78xFcQJtCkLrCh9J1R08H8eDFJ/z9YSjRK/n7PicllWWm2x14dEcCnAJtb+DipogY9A8GqI5WFmbtxBstsWUfVwMl5e194V0WIBx/A6z9f7Tr1zUiR0= BLUPR0701MB1716: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BLUPR0701MB1716;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1716; X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(479174004)(377454003)(164054003)(51704005)(93886004)(66066001)(83506001)(65956001)(50466002)(87976001)(65806001)(64126003)(19580395003)(19580405001)(53416004)(122386002)(40100003)(62966003)(50986999)(33656002)(42186005)(54356999)(46102003)(77156002)(65816999)(76176999)(47776003)(92566002)(4001350100001)(189998001)(110136002)(5001960100002)(2950100001)(36756003)(5001920100001)(77096005);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1716;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;BLUPR0701MB1716;23:1pp1nb4jMBORP39DVL62tSVHSiZfEj8eGVF+9?= =?iso-8859-1?Q?fwLgD+vX9nJZOs7d0e55FgD0JT6nk+HBDYo1h/Bw5KNDO03x/VxGLuB1Zc?= =?iso-8859-1?Q?JEYLqVtDaWFISS1RrrVbpBc0heOCR9PJ/m6V6iCVYrNGAHVXJYxG/vEbbc?= =?iso-8859-1?Q?UmcAP76usK0Jw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?iso-8859-1?Q?VAFno65h9dcBakLXAWeOkAg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1716;5:dk2UVRCdvxSYHY7L7b8+Tz0u01m531q8oVqOLarjj4RLuv0P7tSKQ05dPCb8JxfJwR40gsBXC1vSMRbarbHtY4nYSiJJA5cWWgThC5cJwfl07sy08KIFdTpKsIQNLFooy8zOYv5o7V/BcNmxJSxO3A==;24:knL6WGe2I9WyBQZ+jMFpt4X6K6BeWGwlCeo3N4vv7C2SUPfKj21u6BC+L0lWMa6Lyf0QcYmtwYAONcAiU8Ed8oQ+Z6Uqa0JVg/GZ+LHeIOo=;20:DLU6cgNszr9hDQZotN92x1UhAcTjXeQ2r3/MdWWTsQJyqTOUpq0I+Ee9emsr82btjYH/JNK7YTLzvs/egPIguw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2015 16:58:24.3974 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1716 X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1636;2:tp2vqYJvjUR9Isva3hREzwq0b/lsfg/dzSSXOuH0S0GoPK2/am7Z8iPTlcf/jfSQ;3:oqNRnSzw7FsvGbKqDHJwaeJr6heHEg0OVDcAju4gwU8Gff7nz62U6hf8NcsYNPNLf0xtcVZnm/i+a27DE4u3GuVezj5OwFteArlQWuHHVROtQ4eXswln72obY8/B/Ok/u3Fh0400ZpIZHhZ0THeGfg==;25:hYiUCXUkZ+C11W9YQ1rOQDxAYjracc54FHvheLLsGVnfVHOSZ5ufvmbjtgqEXpZfSGXKxg4aByj+v4LOeml/znRQbS+SHXlRxc1ygiX/O3/72cqSWmQ0HpwhtghWmWZqXjsUgNqWL5JRgQmacls8ICmVkCSsxqwFXFkDebKKQdeTXvcRYZrwrLS6R46Oa0cNj+5M++IqL4zRR0hMxfqNZyQc/sF6EMCmy/KPw6mO3Zk=;20:btjsi1IWcjs3mbbE1jooVD0TLAiVlCsxRWGC+yrvrRnQI8vaKD/LuBKDAOYOM91I9R2SSTtaJY//eTc/A837zg==;23:QmlumSSlQoDKjJh452Tr5W1o2ifHR7Ivxc8PvN0QR9z9qgi2Nel7eGXsSdt09LgadmxqOgZBetwdOeF/pO3KVrjxxIWiiPG9NNwCYosCOjRHC5jquFZtSKoqmcZaWYLEOT/I8HMJe0PjLcF9uFn+8co1Y7QXR5Dz9n1gt0uiOmHi7Cm4uB2pJmeB5D+0fe+8hwm+8En+BVpe3TQgengYwzhS8D5m3Ey2fAY52uE4zQdWI44xTDMTlbKOzc+WOaw5 BLUPR0701MB1636: X-MS-Exchange-Organization-RulesExecuted X-OriginatorOrg: caviumnetworks.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2222 Lines: 72 On 07/14/2015 09:29 AM, Will Deacon wrote: > On Tue, Jul 14, 2015 at 05:12:57PM +0100, David Daney wrote: >> On 07/14/2015 04:00 AM, Will Deacon wrote: >>> On Mon, Jul 13, 2015 at 10:31:36PM +0100, David Daney wrote: >>>> From: David Daney >>>> >>>> Needed to make pci_iomap() work. >>> >>> Care to elaborate? >>> >> >> I should have explained what I am doing here a little better. > > Yeah, thanks. > >> Systems based on the Cavium ThunderX processor may have up to 8 >> independent PCIe root complexes. The I/O space on each bus occupies an >> independent physical address window. > > Hmm, so do you have 64k of I/O space per-bus? That gives 8x256x64k = 128M > IIUC, so not sure what your 32MB is for. I don't understand where your 256 came from there. Actually, my current implementation has 1M per bus(which is overkill). For 8 buses I need 8M, which fits within the PCI_IO_SIZE... > >> So, in order to be able to map all of these (semi) contiguously, we need >> a lot more virtual address space than is supplied by the default values >> for all these constants. >> >> The option I chose here was to unconditionally expand the I/O ranges for >> all arm64 systems. If you think this breaks existing systems/drivers, I >> will have to look for other options. > > Hmm, but pci_iomap winds up calling __pci_ioport_map, which expands to > ioport_map which just does: > > return PCI_IOBASE + (port & IO_SPACE_LIMIT); > > so I'm struggling to see what your patch achieves. Here is ioport_map (from lib/iomap.c): void __iomem *ioport_map(unsigned long port, unsigned int nr) { if (port > PIO_MASK) return NULL; return (void __iomem *) (unsigned long) (port + PIO_OFFSET); } With the default value of PIO_MASK (64K), I cannot map any I/O ports on my PCIe RC 1..7 The values I supplied in my patch may be sub-optimal, but I think something is needed. I will look into this in a little more detail today. Thanks, David Daney > > Will > -- 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/