Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp586405pxk; Thu, 17 Sep 2020 10:36:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2v6vdc6xOmHUDw2MYk9mt8VrLMhIbTADijAvSSJZ9eg7kypRWGYw++KAIMlpREjxgv1aW X-Received: by 2002:a50:9d0a:: with SMTP id v10mr33740608ede.144.1600364198850; Thu, 17 Sep 2020 10:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600364198; cv=none; d=google.com; s=arc-20160816; b=Iw2nuQv2/UE/sIosG4db+v3RM7YxwWOkWumytGGGrzS4G4wsraDJBQlKCobjev08Yd jSFZ0tJBsIC5wpodHGEvtqjUFRaDr2/ePzXqm0hlVU2wCwl0YztYoGiu9IYwFpQVcCa4 b6yFGTqaEg2ARuKhKh8hw57IrnuwjXba6bIUGj8GfCZVIIrJspXxjeWVBy9lie9+j2sl e4RVLY5aJMshAhzZEO3mUdTaZplQ7b6eyic8gadpfDiC0cfVFh7/4sRfKGlGaK15ipzC l8pGuB3IneDTV5cXLVt6e60DX9flQr6QOxbx5TM7jdWyoSZOytN16LhEzrtnXMx1rT4S nMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=Pu0yq8mCUmCypZ9LxScnpiwsPoYUw2vvj2WkpVdWNc4=; b=nBoB9SaEsxJ5B0nZEByyxsSZqoS7n9lRAfXvDsrjzgBq3fjpkG2AUKkO9PfHz8lSms OvWGGN+g+y23++yMuxsJXM+XZb52qv6FtiAOrNSat4r1ScM+6lujlsTyLKOjGxjbeeaI lbhy1B+NZ0KWP9dcSi92nBdY+kiuPgzuZtLpOWH4GQGVCtf412sblx6PSkpHMtmPN1P0 NvVMwcAptZMZBZ0qfIWS44NoYFeuuEK5fB2an8qPAZZ2dcGkzGTtXi9AcwAqH+sZGb8o 6xi2xGZtSV4mNI8iZjGYh7Y+2qcam7VQIhzrJ3MsEHES5GCY91sxr1lf8ZPsYF2Bxf3x rDGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L3luejnW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si389394ejx.195.2020.09.17.10.36.14; Thu, 17 Sep 2020 10:36:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L3luejnW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726402AbgIQRdp (ORCPT + 99 others); Thu, 17 Sep 2020 13:33:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:38684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbgIQRdN (ORCPT ); Thu, 17 Sep 2020 13:33:13 -0400 Received: from localhost (52.sub-72-107-123.myvzw.com [72.107.123.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB6CB20725; Thu, 17 Sep 2020 17:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600363992; bh=nWMmHBbmbhvD0r3jch7hRRWF1Si4T12WC6cr5pBZNrg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=L3luejnWrrhIOPgufNxNcgkKfqMiqRm0e0ut9HolHPjqCnIUJDh/uwGOsXPs+m6SR Tw8e53m+oxpIfW5L9CVoYtbvsKJ1F4DDagmY26li9FqW+LjtoJXn/eIyVritbDSTuX CS9GkCeugNA6yt3l74Yb3KjZ/cu1jYfe7WJH9GBQ= Date: Thu, 17 Sep 2020 12:33:10 -0500 From: Bjorn Helgaas To: Tuan Phan Cc: patches@amperecomputing.com, Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/ACPI: Add Ampere Altra SOC MCFG quirk Message-ID: <20200917173310.GA1714144@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1596751055-12316-1-git-send-email-tuanphan@os.amperecomputing.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 06, 2020 at 02:57:34PM -0700, Tuan Phan wrote: > Ampere Altra SOC supports only 32-bit ECAM reading. Therefore, > add an MCFG quirk for the platform. > > Signed-off-by: Tuan Phan Applied to pci/enumeration for v5.10, thanks! > --- > drivers/acpi/pci_mcfg.c | 20 ++++++++++++++++++++ > drivers/pci/ecam.c | 10 ++++++++++ > include/linux/pci-ecam.h | 1 + > 3 files changed, 31 insertions(+) > > diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c > index 54b36b7ad47d..e526571e0ebd 100644 > --- a/drivers/acpi/pci_mcfg.c > +++ b/drivers/acpi/pci_mcfg.c > @@ -142,6 +142,26 @@ static struct mcfg_fixup mcfg_quirks[] = { > XGENE_V2_ECAM_MCFG(4, 0), > XGENE_V2_ECAM_MCFG(4, 1), > XGENE_V2_ECAM_MCFG(4, 2), > + > +#define ALTRA_ECAM_QUIRK(rev, seg) \ > + { "Ampere", "Altra ", rev, seg, MCFG_BUS_ANY, &pci_32b_read_ops } > + > + ALTRA_ECAM_QUIRK(1, 0), > + ALTRA_ECAM_QUIRK(1, 1), > + ALTRA_ECAM_QUIRK(1, 2), > + ALTRA_ECAM_QUIRK(1, 3), > + ALTRA_ECAM_QUIRK(1, 4), > + ALTRA_ECAM_QUIRK(1, 5), > + ALTRA_ECAM_QUIRK(1, 6), > + ALTRA_ECAM_QUIRK(1, 7), > + ALTRA_ECAM_QUIRK(1, 8), > + ALTRA_ECAM_QUIRK(1, 9), > + ALTRA_ECAM_QUIRK(1, 10), > + ALTRA_ECAM_QUIRK(1, 11), > + ALTRA_ECAM_QUIRK(1, 12), > + ALTRA_ECAM_QUIRK(1, 13), > + ALTRA_ECAM_QUIRK(1, 14), > + ALTRA_ECAM_QUIRK(1, 15), > }; > > static char mcfg_oem_id[ACPI_OEM_ID_SIZE]; > diff --git a/drivers/pci/ecam.c b/drivers/pci/ecam.c > index 8f065a42fc1a..b54d32a31669 100644 > --- a/drivers/pci/ecam.c > +++ b/drivers/pci/ecam.c > @@ -168,4 +168,14 @@ const struct pci_ecam_ops pci_32b_ops = { > .write = pci_generic_config_write32, > } > }; > + > +/* ECAM ops for 32-bit read only (non-compliant) */ > +const struct pci_ecam_ops pci_32b_read_ops = { > + .bus_shift = 20, > + .pci_ops = { > + .map_bus = pci_ecam_map_bus, > + .read = pci_generic_config_read32, > + .write = pci_generic_config_write, > + } > +}; > #endif > diff --git a/include/linux/pci-ecam.h b/include/linux/pci-ecam.h > index 1af5cb02ef7f..033ce74f02e8 100644 > --- a/include/linux/pci-ecam.h > +++ b/include/linux/pci-ecam.h > @@ -51,6 +51,7 @@ extern const struct pci_ecam_ops pci_generic_ecam_ops; > > #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS) > extern const struct pci_ecam_ops pci_32b_ops; /* 32-bit accesses only */ > +extern const struct pci_ecam_ops pci_32b_read_ops; /* 32-bit read only */ > extern const struct pci_ecam_ops hisi_pcie_ops; /* HiSilicon */ > extern const struct pci_ecam_ops thunder_pem_ecam_ops; /* Cavium ThunderX 1.x & 2.x */ > extern const struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */ > -- > 2.18.4 >