From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934297AbbJHPkN (ORCPT ); Thu, 8 Oct 2015 11:40:13 -0400 Received: from mail-bl2on0100.outbound.protection.outlook.com ([65.55.169.100]:36103 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933645AbbJHPkJ (ORCPT ); Thu, 8 Oct 2015 11:40:09 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@caviumnetworks.com; Message-ID: <56168E4E.3070405@caviumnetworks.com> Date: Thu, 8 Oct 2015 08:39:58 -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: Arnd Bergmann , Will Deacon , Lorenzo Pieralisi CC: , Bjorn Helgaas , Mark Rutland , , Pawel Moll , Ian Campbell , Marc Zyngier , , David Daney , , Rob Herring , David Daney , Kumar Gala , Bjorn Helgaas Subject: Re: [PATCH v4 4/5] PCI: generic: Correct, and avoid overflow, in bus_max calculation. References: <1443811443-18878-1-git-send-email-ddaney.cavm@gmail.com> <20151008150243.GC3885@localhost> <5230007.h2fkbnOlh5@wuerfel> <5178627.ufUfdomGdT@wuerfel> In-Reply-To: <5178627.ufUfdomGdT@wuerfel> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: SN2PR07CA008.namprd07.prod.outlook.com (10.255.174.25) To CY1PR07MB2136.namprd07.prod.outlook.com (25.164.112.14) X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2136;2:z0Q6GxUV9Zl4TRL4C4EOVyGlw/dtopPRKqBcOc5VHE8EG4yrpufq8sNiGY1bFlyjOY1lkdCa+jYrOsO2guCVTNEGFkFXmZUN+xI+bcOfsvM7TwVVGgMITWxBspb1Jn/ne3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BUh6tqMqTtAFswVlISSx4o8xBi8lBmcVEQCSuagZjW3hb1p1V+/c6Th9PN3bDIQAzGuHjAJ2j/faNfVWOXkQDl9w+lAR3NnF9vM6N9pvD352N+o0RVZsseCNLmmmY= 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:CY1PR07MB2136;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2136; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2136;4:Hyn3+uS9iwqqVB3bKgSdqgQIK4YG7S8G0X2lfoCO1jah1mNCD0C2AgEIdOsnn5/y8NcrqAMiviTKp6qFlvvCd64eWmtZCvfu2CmFPzGaljybvD4kW8+pCDPX3ufyhb1tkh2+4wss/81Jo4WgLXcdxEudXdXyYQBlc8SRiP6WDjyziyCXpwLjJ7KEv8s6ghOw3kF0haUN3PzGiaUKcj4nEnaFzwcuWmjDOIfw9vLPeSlJFTOsr8tTZ/n4TYEq799OvYoeJy8/Ca2RyowNlhhRA9CO7snOqR/n6MEcmZnBaNknx9BeKcsfm87AINey8aVGs7RtEgzf2XzzmihkLV1ShI6Tvu/c2XxM4XczYkwJ2hI= X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(479174004)(199003)(377454003)(189002)(189998001)(36756003)(64706001)(50986999)(105586002)(50466002)(93886004)(106356001)(23756003)(66066001)(5007970100001)(5004730100002)(65956001)(5001960100002)(65806001)(77096005)(81156007)(4001350100001)(5001770100001)(97736004)(5008740100001)(64126003)(46102003)(47776003)(122386002)(59896002)(69596002)(83506001)(99136001)(80316001)(19580395003)(42186005)(53416004)(40100003)(87976001)(92566002)(2950100001)(87266999)(101416001)(65816999)(54356999)(33656002)(76176999)(41533002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2136;H:dl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;CY1PR07MB2136;23:3mm+Wl85hnk43W1zv5C9QSW939fctrYvrYf5Cbw?= =?iso-8859-1?Q?ZN2RR2jpmsxD36I8N26d9lvbK3FkevRl8s4Xue8SpnGEJzV4gMAq37Mkmi?= =?iso-8859-1?Q?gPZzHLL4gacdc0DiE0cTMiPH9HYjkrh5hfDDKp12pUI+WwEX584ajS3+bX?= =?iso-8859-1?Q?RiT1/KZ7zcXaUyDaK/KUlys8IBOIVGARKf4uVyQu11QXywopg+OT8GH2M/?= =?iso-8859-1?Q?UuaG4W7+dUWtt0bK0AFc+n2MlFgV8MIeCyqMkkAiLDM9HZZ8UhlTC6X/8+?= =?iso-8859-1?Q?+02+8k5Zuys0jbjxyz29oHjZVyI50sUNJVTkhy1llw+IrHFjdCOnNlHBw7?= =?iso-8859-1?Q?dITRzvlvA58eIyyt+WXrDoZe+31oRcfebab7QAr2GYp8URoMLZ3cVZC1I8?= =?iso-8859-1?Q?FozsNHJYWRFM6nA+xIzPErMpCJmchXPqIHDcQWyy9Qh+eAmrClDVQ4e+jL?= =?iso-8859-1?Q?OZaZP0FM5hwzQoUvKX0aoa9iE5rk8BnqlUbw5dBFd2Zg0BjqeOqNuYO5yO?= =?iso-8859-1?Q?H2WcTzOp/9oEox8OZpPS4zMjHgCBqqTrb50TtTGdTFz99f5b+upq9tp2Cu?= =?iso-8859-1?Q?o8LfcanxvGd4utaQ+SYG8eK06sQLDzfE8zOTAlibx3bmSzTbFZ7fITn7Qm?= =?iso-8859-1?Q?wmD3fIzbNYlHZi8HtDIKPVs8DdKgZuX5PBFuy+s8wGOUA8dk7nvPmXbHK2?= =?iso-8859-1?Q?bZTN12dGQkM7vl1JqgR6Jb4fH+e6Ch7qL0fTMxsbM2tp1Am31gnO6B6Rt/?= =?iso-8859-1?Q?nag3clh6S4SUAYXULCTuVreBxqglR7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7zVYSHDHdv/TP9brCI/RjJ2Owi+bIw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2015 15:40:01.7463 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2136 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/08/2015 08:18 AM, Arnd Bergmann wrote: > On Thursday 08 October 2015 17:11:32 Arnd Bergmann wrote: >>>> --- a/Documentation/devicetree/bindings/pci/host-generic-pci.txt >>>> +++ b/Documentation/devicetree/bindings/pci/host-generic-pci.txt >>>> @@ -34,7 +34,11 @@ Properties of the host controller node: >>>> - #size-cells : Must be 2. >>>> >>>> - reg : The Configuration Space base address and size, as accessed >>>> - from the parent bus. >>>> + from the parent bus. The base address corresponds to >>>> + bus zero, even though the "bus-range" property may specify >>>> + a different starting bus number. The driver must only map >>>> + or access the portion of the Configuration Space that >>>> + corresponds to the "bus-range" >> >> I thought we had reached an agreement that it is a bad idea to have a 'reg' >> property that lists registers belonging to a different device. >> >> > > To further clarify: the argument was to make it mirror what ACPI does for > PCI. However, this is unlike what all other devices do with DT, where you > have non-overlapping register ranges (start, length) for each device. > ACPI as far as I understand it does not give a range for a PCIe host, but > instead provides a way to get the start address of the ECAM register area > for the domain that the host is part of, and that needs to be the same > address for each host in the domain. > We are agreed that it is a bad thing to do. There is disagreement about if we should do it. I think there are two schools of thought (I will attribute them to their proponents and my apologies if I misrepresent someone's stance): 1) (Arnd) Don't make the the "reg" ranges overlap because it is ugly, dangerous and arguably incorrect in general. 2) (Me, Will Deacon, Lorenzo Pieralisi) Overlapping "reg" properties should be maintained, as that is the current behavior and seems to agree with legacy OF device-tree specifications (although there is some debate about this). Because the driver is broken in this area (thus the patch), it indicates that there are probably no users with non-zero starting bus numbers. So, we may have some latitude to change it. I will generate another patch that does it Arnd's way, and if Will is OK with it, we might be able to do that instead. One thing is certain: The driver is currently broken for non-zero starting bus numbers. David Daney