From patchwork Wed Feb 20 09:48:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 10821785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1535E6CB for ; Wed, 20 Feb 2019 10:00:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F29D82DA77 for ; Wed, 20 Feb 2019 10:00:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E67332DD39; Wed, 20 Feb 2019 10:00:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DB082DA77 for ; Wed, 20 Feb 2019 10:00:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727188AbfBTKAs (ORCPT ); Wed, 20 Feb 2019 05:00:48 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:36152 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727139AbfBTKAs (ORCPT ); Wed, 20 Feb 2019 05:00:48 -0500 Received: from relay12.mail.gandi.net (unknown [217.70.178.232]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 55FC53A7134 for ; Wed, 20 Feb 2019 09:48:50 +0000 (UTC) Received: from localhost (aaubervilliers-681-1-81-190.w90-88.abo.wanadoo.fr [90.88.23.190]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 534AB200015; Wed, 20 Feb 2019 09:48:46 +0000 (UTC) From: Thomas Petazzoni To: Bjorn Helgaas , Lorenzo Pieralisi , linux-pci@vger.kernel.org Cc: Russell King , linux-arm-kernel@lists.infradead.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , =?utf-8?q?Lu=C3=ADs_Mendes?= , Leigh Brown , Thomas Petazzoni Subject: [PATCH 0/2] PCI: fix pci-mvebu after conversion to common bridge emul code Date: Wed, 20 Feb 2019 10:48:39 +0100 Message-Id: <20190220094841.11129-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, This set of two patches aim at fixing some regression reported by two users (Luis and Leigh), that were introduced by the conversion of the pci-mvebu driver to the common PCI bridge emulation code shared between pci-aardvark and pci-mvebu. Due to this conversion, some registers of the PCI configuration that used to be read-only are now read-write, making the Linux PCI core believe that some features are implemented by the PCI bridge. Namely in the case of pci-mvebu, the prefetchable memory base/limit registers were read-only, while they are now read-write. Due to this, the Linux PCI core now believes it can configure a prefetchable memory area, but this is not supported by pci-mvebu, which does not have the logic to create the appropriate MBUs windows. This set of two commits allow PCI controller code to tell the PCI bridge emulation logic about their capabilities. Because we envision that other capabilities than prefetchable memory support might need to be communicated from the PCI controller code to the PCI bridge emulation code in the future, we introduce a "flags" argument, even if for now only one flag is supported. Lorenzo, let me know what you think about this approach. I am open to suggestions if the proposed approach is not satisfying. Both patches have been confirmed by Luis and Leigh to fix the regression, but I'll let them give a formal Tested-by. Best regards, Thomas Petazzoni Thomas Petazzoni (2): PCI: pci-bridge-emul: Create per-bridge copy of register behavior PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags drivers/pci/controller/pci-aardvark.c | 2 +- drivers/pci/controller/pci-mvebu.c | 2 +- drivers/pci/pci-bridge-emul.c | 86 ++++++++++++++++++--------- drivers/pci/pci-bridge-emul.h | 13 +++- 4 files changed, 73 insertions(+), 30 deletions(-) Acked-by: Bjorn Helgaas Tested-by: Leigh Brown