From patchwork Tue Jan 28 09:47:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 3546041 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 666629F381 for ; Tue, 28 Jan 2014 09:48:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FA0D20149 for ; Tue, 28 Jan 2014 09:48:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64A6020165 for ; Tue, 28 Jan 2014 09:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744AbaA1JsC (ORCPT ); Tue, 28 Jan 2014 04:48:02 -0500 Received: from 82-68-191-81.dsl.posilan.com ([82.68.191.81]:51235 "EHLO rainbowdash.ducie.codethink.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754471AbaA1Jr6 (ORCPT ); Tue, 28 Jan 2014 04:47:58 -0500 Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1W85Gr-00021w-3B; Tue, 28 Jan 2014 09:47:53 +0000 From: Ben Dooks To: linux-kernel@lists.codethink.co.uk Cc: Ben Dooks , Valentine Barshak , Simon Horman , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org Subject: [PATCH 3/3] PCI: rcar: fix bridge logic abort Date: Tue, 28 Jan 2014 09:47:48 +0000 Message-Id: <1390902468-7753-4-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1390902468-7753-1-git-send-email-ben.dooks@codethink.co.uk> References: <1390902468-7753-1-git-send-email-ben.dooks@codethink.co.uk> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The bridge logic at slot 0 only supports reads up to 0x40 and the rest of the PCI configuration space for this slot is marked as reserved in the manual. Trying a read from offset 0x100 is producing an error from the bridge. With error interrupts enabled, the following is printed: pci-rcar-gen2 ee0d0000.pci: error irq: status 00000014 Signed-off-by: Ben Dooks --- Cc: Valentine Barshak Cc: Simon Horman Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org --- drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c index 01ba069..17ad857 100644 --- a/drivers/pci/host/pci-rcar-gen2.c +++ b/drivers/pci/host/pci-rcar-gen2.c @@ -119,6 +119,10 @@ static void __iomem *rcar_pci_cfg_base(struct pci_bus *bus, unsigned int devfn, if (slot > 2) return NULL; + /* bridge logic only has registers to 0x40 */ + if (slot == 0x0 && where >= 0x40) + return NULL; + val = slot ? RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG : RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG; @@ -134,6 +138,8 @@ static int rcar_pci_read_config(struct pci_bus *bus, unsigned int devfn, if (!reg) return PCIBIOS_DEVICE_NOT_FOUND; + dev_info(&bus->dev, "fn %08x, read %08x, size %d\n", devfn, where, size); + switch (size) { case 1: *val = ioread8(reg); @@ -157,6 +163,8 @@ static int rcar_pci_write_config(struct pci_bus *bus, unsigned int devfn, if (!reg) return PCIBIOS_DEVICE_NOT_FOUND; + dev_info(&bus->dev, "devfn %08x: write %08x to %08x, size %d\n", devfn, val, where, size); + switch (size) { case 1: iowrite8(val, reg);