Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751831AbcDUJ2o (ORCPT ); Thu, 21 Apr 2016 05:28:44 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36142 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbcDUJ2j (ORCPT ); Thu, 21 Apr 2016 05:28:39 -0400 Subject: Re: [PATCH V6 08/13] PCI: generic, thunder: update to use generic ECAM API To: Arnd Bergmann References: <1460740008-19489-1-git-send-email-tn@semihalf.com> <10639671.xGDtp1R8bk@wuerfel> <5715362A.7070701@semihalf.com> <3830999.dF71UWYsBP@wuerfel> Cc: Jayachandran C , linux-arm-kernel@lists.infradead.org, Bjorn Helgaas , Will Deacon , Catalin Marinas , rafael@kernel.org, Hanjun Guo , Lorenzo Pieralisi , Sinan Kaya , jiang.liu@linux.intel.com, Jon Masters , linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, Liviu.Dudau@arm.com, David Daney , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, Wangyijing , Marcin Wojtas From: Tomasz Nowicki Message-ID: <57189D2F.9070802@semihalf.com> Date: Thu, 21 Apr 2016 11:28:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <3830999.dF71UWYsBP@wuerfel> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1160 Lines: 30 On 19.04.2016 15:06, Arnd Bergmann wrote: > On Monday 18 April 2016 21:31:54 Tomasz Nowicki wrote: >> >> Basically the whole content of pci-thunder-ecam.c and pci-thunder-pem.c. >> >> pci-thunder-ecam.c contains config space accessors. Similar for >> pci-thunder-pem.c but it also has extra init call (it is now called >> thunder_pem_init) which finds and maps related registers. > > They seem to do much more than just override the accessors, they actually > change the contents of the config space as well. Is that really necessary > on ACPI based systems as well? Yes, the pci-thunder-ecam.c accessors are meant to emulate config space capabilities. They are necessary to synthesize EA capabilities (fixed PCI BARs), it wont work without this, for ACPI boot as well. > > Another idea: how about moving all of this logic into ACPI and calling > some AML method to access the config space if the devices are that > far out of spec. Do you mean Linux specific way to call non-standard config space accessors? Then non-standard accessors are going to AML methods which are called from common code which handles quirks via unified API ? Thanks, Tomasz