From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754035AbcAHOQ2 (ORCPT ); Fri, 8 Jan 2016 09:16:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51003 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbcAHOQZ (ORCPT ); Fri, 8 Jan 2016 09:16:25 -0500 Message-ID: <1452262581.31901.26.camel@redhat.com> Subject: Re: [PATCH V2 22/23] pci, acpi: Match PCI config space accessors against platfrom specific quirks. From: Mark Salter To: Tomasz Nowicki , bhelgaas@google.com, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, rjw@rjwysocki.net, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com, okaya@codeaurora.org, jiang.liu@linux.intel.com, Stefano.Stabellini@eu.citrix.com Cc: robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, tglx@linutronix.de, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jchandra@broadcom.com, jcm@redhat.com Date: Fri, 08 Jan 2016 09:16:21 -0500 In-Reply-To: <1450278993-12664-23-git-send-email-tn@semihalf.com> References: <1450278993-12664-1-git-send-email-tn@semihalf.com> <1450278993-12664-23-git-send-email-tn@semihalf.com> Organization: Red Hat, Inc Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-12-16 at 16:16 +0100, Tomasz Nowicki wrote: > Some platforms may not be fully compliant with generic set of PCI config > accessors. For these cases we implement the way to overwrite accessors > set before PCI buses enumeration. Algorithm that overwrite accessors > matches against platform ID (DMI), domain and bus number, hopefully > enough for all cases. All quirks can be defined using: > DECLARE_ACPI_MCFG_FIXUP() and keep self contained. > > example: > > static const struct dmi_system_id yyy[] = { >         { >                 .ident = "", >                 .callback = , >                 .matches = { >                         DMI_MATCH(DMI_SYS_VENDOR, ""), >                         DMI_MATCH(DMI_PRODUCT_NAME, ""), >                         DMI_MATCH(DMI_PRODUCT_VERSION, "product version"), >                 }, >         }, >         { } > }; > This seems awkward to me in the case where the quirk is SoC-based and there may be multiple platforms affected. Needing a DECLARE_ACPI_MCFG_FIXUP for each platform using such a SoC (i.e. Mustang and Moonshot) doesn't seem right. In that case, I think it'd be better to check CPUID and possibly some SoC register to cover all platforms affected. Also, there doesn't seem to be a way to connect a given quirk check to the MCFG/device requesting the ops. So if there is a platform with multiple PCIE roots and not all of them have quirks, how does one no whether to override the default ecam ops?