{"id":811429,"url":"http://patchwork.ozlabs.org/api/patches/811429/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20170908095348.16578-2-thomas.petazzoni@free-electrons.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170908095348.16578-2-thomas.petazzoni@free-electrons.com>","list_archive_url":null,"date":"2017-09-08T09:53:42","name":"[1/7] PCI: aardvark: fix logic in PCI configuration read/write functions","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"59978e0ce7caf3d1c128e9c009a88f246e412458","submitter":{"id":2230,"url":"http://patchwork.ozlabs.org/api/people/2230/?format=json","name":"Thomas Petazzoni","email":"thomas.petazzoni@free-electrons.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20170908095348.16578-2-thomas.petazzoni@free-electrons.com/mbox/","series":[{"id":2162,"url":"http://patchwork.ozlabs.org/api/series/2162/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=2162","date":"2017-09-08T09:53:41","name":"PCI: aardvark: improve compatibility with PCI devices","version":1,"mbox":"http://patchwork.ozlabs.org/series/2162/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/811429/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/811429/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-pci-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-pci-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpXhq3XZKz9sBd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 19:54:03 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753715AbdIHJyB (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 8 Sep 2017 05:54:01 -0400","from mail.free-electrons.com ([62.4.15.54]:41944 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751894AbdIHJx7 (ORCPT\n\t<rfc822;linux-pci@vger.kernel.org>); Fri, 8 Sep 2017 05:53:59 -0400","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 50E5821D2B; Fri,  8 Sep 2017 11:53:57 +0200 (CEST)","from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 2C5B220A4E;\n\tFri,  8 Sep 2017 11:53:57 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","From":"Thomas Petazzoni <thomas.petazzoni@free-electrons.com>","To":"Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org","Cc":"Nadav Haklai <nadavh@marvell.com>, Hanna Hawa <hannah@marvell.com>,\n\tYehuda Yitschak <yehuday@marvell.com>, Victor Gu <xigu@marvell.com>,\n\tJason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,\n\tSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Gregory Clement\n\t<gregory.clement@free-electrons.com>, \n\tlinux-arm-kernel@lists.infradead.org, =?utf-8?q?Miqu=C3=A8l_Raynal?=\n\t<miquel.raynal@free-electrons.com>, Antoine Tenart\n\t<antoine.tenart@free-electrons.com>,         stable@vger.kernel.org,\n\tThomas Petazzoni <thomas.petazzoni@free-electrons.com>","Subject":"[PATCH 1/7] PCI: aardvark: fix logic in PCI configuration\n\tread/write functions","Date":"Fri,  8 Sep 2017 11:53:42 +0200","Message-Id":"<20170908095348.16578-2-thomas.petazzoni@free-electrons.com>","X-Mailer":"git-send-email 2.13.5","In-Reply-To":"<20170908095348.16578-1-thomas.petazzoni@free-electrons.com>","References":"<20170908095348.16578-1-thomas.petazzoni@free-electrons.com>","Sender":"linux-pci-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-pci.vger.kernel.org>","X-Mailing-List":"linux-pci@vger.kernel.org"},"content":"From: Victor Gu <xigu@marvell.com>\n\nThe PCI configuration space read/write functions were special casing\nthe situation where PCI_SLOT(devfn) != 0, and returned\nPCIBIOS_DEVICE_NOT_FOUND in this case.\n\nHowever, will this is what is intended for the root bus, it is not\nintended for the child busses, as it prevents discovering devices with\nPCI_SLOT(x) != 0. Therefore, we return PCIBIOS_DEVICE_NOT_FOUND only\nif we're on the root bus.\n\nFixes: 8c39d710363c1 (\"PCI: aardvark: Add Aardvark PCI host controller driver\")\nCc: <stable@vger.kernel.org>\nSigned-off-by: Victor Gu <xigu@marvell.com>\nReviewed-by: Wilson Ding <dingwei@marvell.com>\nReviewed-by: Nadav Haklai <nadavh@marvell.com>\n[Thomas: tweak commit log.]\nSigned-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>\n---\n drivers/pci/host/pci-aardvark.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c\nindex 5fb9b620ac78..582d75f864e3 100644\n--- a/drivers/pci/host/pci-aardvark.c\n+++ b/drivers/pci/host/pci-aardvark.c\n@@ -441,7 +441,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,\n \tu32 reg;\n \tint ret;\n \n-\tif (PCI_SLOT(devfn) != 0) {\n+\tif ((bus->number == pcie->root_bus_nr) && (PCI_SLOT(devfn) != 0)) {\n \t\t*val = 0xffffffff;\n \t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n \t}\n@@ -495,7 +495,7 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn,\n \tint offset;\n \tint ret;\n \n-\tif (PCI_SLOT(devfn) != 0)\n+\tif ((bus->number == pcie->root_bus_nr) && (PCI_SLOT(devfn) != 0))\n \t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n \n \tif (where % size)\n","prefixes":["1/7"]}