From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbbJEQtz (ORCPT ); Mon, 5 Oct 2015 12:49:55 -0400 Received: from mail-bl2on0067.outbound.protection.outlook.com ([65.55.169.67]:11712 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750879AbbJEQtw (ORCPT ); Mon, 5 Oct 2015 12:49:52 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@caviumnetworks.com; Message-ID: <5612AA26.90607@caviumnetworks.com> Date: Mon, 5 Oct 2015 09:49:42 -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: Yinghai Lu CC: Bjorn Helgaas , "Sean O. Stalley" , Linux Kernel Mailing List , "linux-pci@vger.kernel.org" , "Michael S. Tsirkin" , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , , Rajat Jain , "gong.chen@linux.intel.com" , David Daney Subject: Re: [PATCH v4 0/5] PCI: Add support for PCI Enhanced Allocation "BARs" References: <1443825476-26880-1-git-send-email-ddaney.cavm@gmail.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BY2PR07CA049.namprd07.prod.outlook.com (10.141.251.24) To BN4PR07MB2130.namprd07.prod.outlook.com (25.164.63.12) X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2130;2:DR8SHjkFsHwX2KJD/0KkjxheFMMv59FgLDLp3IF6UAuvSJKMQEV20vsjq9EnIit6csS9DBPnQ/68hotM931giXa2d1RJ3r10NCXVkIsG9R6Wug3PEklyYLBkfPLcPQ/WjR4mxRIWWk147sKiXSpOD6Yofe+b3nQMyq5czEfTdLQ=;3:oWYuabPnoqHYkevjd0ljVqoFB/K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Gy2oDrLOxhAJcesW1Eu7rocjQZxBm/RgHIpZbR0/aJ60ElY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001);SRVR:BN4PR07MB2130;BCL:0;PCL:0;RULEID:;SRVR:BN4PR07MB2130; X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2130;4:q8KczVNKLFm9lt1fJUt2OruHfNgqIX3b7rjwl2XwW1Qc//X+laPHNQshqAn/Euccm6o3ja9BMK2fmsP9esf8dBs2w36+mVKTIsIeE55MxBZzNKpVQ0E6zMcHqA+VchBo7h9ZIniH7+btwqyAWbt6/bHhBnsYz1JqY7M+efWjQEaJwuFE/Ukbiior9sIbdivw9jGnhW3WyWQeOXvqjAKUTKmkM33uDrzsO5kwfUXJa8gd4Y6b0RFISjbdloziRV6xNQ5tRuLxEY8g3NFHnOHRGu0JTb9fQZ4S5WvCsszr1vUGNZThAalhC+vrj/jLdhqr5ZtoNr64cQ/bYMjH1IaqzEddA/vmSPYv8nIN9gjCeag= X-Forefront-PRVS: 07200C0526 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(189002)(479174004)(54094003)(377454003)(199003)(24454002)(46102003)(42186005)(65816999)(65806001)(92566002)(81156007)(40100003)(87976001)(19580405001)(122386002)(5001830100001)(50986999)(19580395003)(77156002)(47776003)(97736004)(4001350100001)(4001540100001)(83506001)(33656002)(189998001)(106356001)(77096005)(105586002)(5008740100001)(65956001)(66066001)(62966003)(64706001)(101416001)(53416004)(69596002)(64126003)(110136002)(2950100001)(5001860100001)(54356999)(76176999)(5004730100002)(23676002)(68736005)(36756003)(5001960100002)(5007970100001)(15975445007)(50466002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN4PR07MB2130;H:dl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-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-8?B?OStwYllxNC9xNjlTTGR5Y2tDQnFEeERWNFBmbm52Q1RSUGlQMThZRml6cDhN?= =?utf-8?B?Qjl6bkZCbG8wZnBiblpCM0RROS9oNEJkMlF3SnZVNm1TUElrOS80VnNCaGZy?= =?utf-8?B?NnU1cVA4RS9OVzNIOVBJNlR3VE9tcFJGTzdvVmZRYmtBMUU3MTE5L1ZRYlJp?= =?utf-8?B?eklDcHpXbTNBPT0=?= X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2130;5:fX1z9vzwRxN9itPcyAJVScrWV45O8jsIfI4tHUij3vy5oQljnlh7/AR64YTL/7lFV4EFyHI/LjmU/GF8B42XMihU5w0B+js3AGa0b30aRTsw0hwGIRgrDS5vGOXDsSN3MlPVDldQzdM1rmwzkycu3Q==;24:JlupSbxJlLa7gfGGVA5YWILT4/2o4Sui3Do6C2fB8g1D3Psc67ta3CukVuV/oJgmqyH29RW1WH0uQfIGxzI4Fq69kL6cNu+qD4XwfOpihuA=;20:wetZmrMs2hJDdPcY0nW3D8qYMOKsxqK4Z8FycZutJqlMEC/nKzAinF7PgGG5a9d/Oy4B3HNp4IlMVq1+Lb2H7g== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2015 16:49:46.4598 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2130 X-Microsoft-Exchange-Diagnostics: 1;BN4PR07MB2147;2:O9jmNMyA7vHkYf7MZwWI6Ehucq3v1CB8fAtxf9Slv8dyTAydMDOkv4FrN/M/EoZwFZL+jv/i5LiJ8uDH55IrmktkeFK/SiHPTHyToL+ldmSebphujyEYIBPPS44G8ivtlwbh5DgqQDKHPsDBL+tsprPDua5vwpwBwGPgvERVZf4=;23:X6xJHyPHcutx5RCrzMQyBVsFDQaY035A4Sin2IgIBu1dnfCjoz/tXbJPpzqSyAvHXnbOKRZ2EM6U0cWI/96NgSg4W7CE+SleWlwDrcT0GGe20OZGar7b7yStqoux7cq+S22m7g1krop3zkgWEpyj2t4X8HGTAHTqcj9sQUIgP+KilGZDmq/YRnZ8P4eXgAtl X-OriginatorOrg: caviumnetworks.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/02/2015 08:16 PM, Yinghai Lu wrote: > On Fri, Oct 2, 2015 at 3:37 PM, David Daney wrote: >> From: David Daney >> >> PCI Enhanced Allocation is a new method of allocating MMIO & IO >> resources for PCI devices & bridges. It can be used instead >> of the traditional PCI method of using BARs. >> >> EA entries are hardware-initialized to a fixed address. >> Unlike BARs, regions described by EA are cannot be moved. >> Because of this, only devices which are permanently connected to >> the PCI bus can use EA. A removable PCI card must not use EA. >> >> The Enhanced Allocation ECN is publicly available here: >> https://www.pcisig.com/specifications/conventional/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf > > Looks like the EA will support more than just fixed address later. > > "Enhanced Allocation is an optional Conventional PCI Capability that > may be implemented by > Functions to indicate fixed (non reprogrammable) I/O and memory ranges > assigned to the > Function, as well as supporting new resource “type” definitions and > future extensibility to also > support reprogrammable allocations." > > so I would prefer to think more to make frame configurable to leave > space for that. I disagree. Currently we know of no use case other than devices with fixed address BARs and bridges to buses containing such devices. Since we have no idea what these future types of EA entries might look like, it is impossible to design a framework to handle them. Since we cannot design the framework, it seems like insisting on the creation of a framework is the equivalent of refusing to handle EA. We have today, actual hardware with configuration space that contains the EA entries defined by the specification. We know how to handle these, it can be done with this patch set. I have no objection to changing the patches so that they fit better with the core PCI code. In fact, I fully expect to do so based on feedback I receive. For the record the general idea is this: IORESOURCE_PCI_FIXED already does almost exactly what we need for EA, there are only a couple of places where we need to fix things for it to work well with the pci-host-generic driver. If we fix these few issues with IORESOURCE_PCI_FIXED, then EA is supported. It also makes doing similar things by setting the IORESOURCE_PCI_FIXED in a "header" fixup. I don't think it make sense to invent an additional flag for fixed EA resources, as it would just be a duplicate of IORESOURCE_PCI_FIXED. David Daney > > Bjorn, > > I wonder if we need to revive the add-on resource support patchset > that i suggested couple years ago, > so we can extend it to support EA features. > > URL: https://lkml.org/lkml/2012/3/19/86 > > Thanks > > Yinghai >