From patchwork Wed Jan 20 22:55:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Jui X-Patchwork-Id: 8075161 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 66C82BEEE5 for ; Wed, 20 Jan 2016 22:55:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9078F20531 for ; Wed, 20 Jan 2016 22:55:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CF29204A9 for ; Wed, 20 Jan 2016 22:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbcATWzP (ORCPT ); Wed, 20 Jan 2016 17:55:15 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:48143 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753233AbcATWzO (ORCPT ); Wed, 20 Jan 2016 17:55:14 -0500 X-IronPort-AV: E=Sophos;i="5.22,322,1449561600"; d="scan'208";a="85791842" Received: from irvexchcas07.broadcom.com (HELO IRVEXCHCAS07.corp.ad.broadcom.com) ([10.9.208.55]) by mail-gw3-out.broadcom.com with ESMTP; 20 Jan 2016 15:34:42 -0800 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS07.corp.ad.broadcom.com (10.9.208.55) with Microsoft SMTP Server (TLS) id 14.3.235.1; Wed, 20 Jan 2016 14:55:12 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.235.1; Wed, 20 Jan 2016 14:55:12 -0800 Received: from mail.broadcom.com (unknown [10.136.8.49]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 28C2E40FE5; Wed, 20 Jan 2016 14:51:23 -0800 (PST) From: Ray Jui To: Bjorn Helgaas CC: Rafal Milecki , Hante Meuleman , Hauke Mehrtens , , , , Ray Jui Subject: [PATCH] PCI: iproc: Fix BCMA PCIe bus scanning regression Date: Wed, 20 Jan 2016 14:55:10 -0800 Message-ID: <1453330510-21926-1-git-send-email-rjui@broadcom.com> X-Mailer: git-send-email 1.9.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-Spam-Status: No, score=-6.9 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 Commit 943ebae781f5 ("PCI: iproc: Add PAXC interface support") causes regression on EP device detection on BCMA based platforms. This patch fixes the issue by allowing multiple devices to be configured on the same bus, for all PAXB based child buses Reported-by: Rafal Milecki Fixes: 943ebae781f5 ("PCI: iproc: Add PAXC interface support") Signed-off-by: Ray Jui --- drivers/pci/host/pcie-iproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index 5816bce..4627561 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -171,10 +171,11 @@ static inline void iproc_pcie_ob_write(struct iproc_pcie *pcie, } static inline bool iproc_pcie_device_is_valid(struct iproc_pcie *pcie, + unsigned int busnum, unsigned int slot, unsigned int fn) { - if (slot > 0) + if ((pcie->type == IPROC_PCIE_PAXC || busnum == 0) && slot > 0) return false; /* PAXC can only support limited number of functions */ @@ -199,7 +200,7 @@ static void __iomem *iproc_pcie_map_cfg_bus(struct pci_bus *bus, u32 val; u16 offset; - if (!iproc_pcie_device_is_valid(pcie, slot, fn)) + if (!iproc_pcie_device_is_valid(pcie, busno, slot, fn)) return NULL; /* root complex access */