From patchwork Tue May 16 00:17:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 9728229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 079B860386 for ; Tue, 16 May 2017 00:18:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F25DB289D8 for ; Tue, 16 May 2017 00:18:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E59DF289DD; Tue, 16 May 2017 00:18:24 +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=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67A68289D8 for ; Tue, 16 May 2017 00:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N7RuPO6Z6vR+/hINLxrijViz8zGgKuDzTlRbl5vNro0=; b=PRxQullBKroZMo dQYd1t0N3VaNFVsRsPibJu8yFTq5n+hMf+EqsYUFj/Vmh2mjWZ7JR36ybMnYVkIdElLiNtxOnwDuM XecKw0wLIps3i9AMInCF2YiB4/ret//wjQQZSXyjdWdtCNc4Ga//yAHvXcEpvK2hX/prs3JFqBWVj f9bK7p1Uz355iUxUD1mGjcTb76SuHuoeO3onjdRZit0BRJ+xF1fGoHTgu906h7dwyDZaQxt0oVqKd AgumAIwq2maZYAHDeBfe1b5PGWBhs9zAnS2zXDaULdp06zdI0at7dwfLnUcEQuxqsktlC4KzdvAxX bRkDUEUOxNKQoK/fIwiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dAQBz-0002a8-6y; Tue, 16 May 2017 00:18:23 +0000 Received: from mail-sn1nam01on0080.outbound.protection.outlook.com ([104.47.32.80] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dAQBl-0002IO-MM for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2017 00:18:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=49s1xi3eJikr+vjPNt5E3Jt7LkmdbWcTU0UXsA9zUY8=; b=B5W2qesvqCuHURE/66dQeMu5rNtb8HJFZuOK8XJd/x/B+2sRsljrAmdUl3usAC6faoaXWo1kyMJTJg4kVEeafTkheJMqhW8GIGAww9ZYeM4lw40RbK4HOA3khnnVv9wwq2P/CGJ9omMQbVkEtNO1LZru6yesA2D+riEQWmLVC98= Authentication-Results: google.com; dkim=none (message not signed) header.d=none; google.com; dmarc=none action=none header.from=cavium.com; Received: from ddl.caveonetworks.com (50.233.148.156) by MWHPR07MB3501.namprd07.prod.outlook.com (10.164.192.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Tue, 16 May 2017 00:17:45 +0000 From: David Daney To: Bjorn Helgaas , linux-pci@vger.kernel.org Subject: [PATCH 1/2] PCI: Allow PCI_DEV_FLAGS_NO_BUS_RESET to be used on bus device. Date: Mon, 15 May 2017 17:17:35 -0700 Message-Id: <20170516001736.4001-2-david.daney@cavium.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170516001736.4001-1-david.daney@cavium.com> References: <20170516001736.4001-1-david.daney@cavium.com> MIME-Version: 1.0 X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: SN1PR0701CA0062.namprd07.prod.outlook.com (10.163.126.30) To MWHPR07MB3501.namprd07.prod.outlook.com (10.164.192.28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9bd26159-6c99-4e7f-d0ba-08d49bf0fa7c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:MWHPR07MB3501; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3501; 3:hjc8bb/A8ppRvU4gHA/2tesaJm1DOjraLzdDkPCieO5CIi2Yx9DOtQApHGBsSuLV8BGNsbKnY7tSY0ISU7iVbr/p5omuWo0fqeOiVTr68+t2FyRg8+zM9bbpH/yWYa/2pKgWMlysjriheFvV8q7Mr+AwECmYtjR7/8Rrh6s1TOt9KC2l4l0KIJGhIw4/1PXias9PK/f2qYPkBe3+qsJ8Z6gTpiOB1iYn1BPBB3J3ANGwRq3dR+k9Nu+6R/OEOGXo8Ir/UG9fyFBTAl31z5G+gp1ADpAggRIYKTETVYvvP173jG3XVPQUAThSK3KNeBZWoIf0IabJ7vQ9UWZe0Mq5Fg==; 25:FIOjPXFmgbRnfiICeXAfzs3CmCuEPH1Ig7x1ygoomw/a4FEXsB1vGSGTpLJYAc8rr9oPkpPTawKr/z0MRPQIrsUKlGCsZI14ZdHrtgzXhHhCeEEVLKlVvjOzxS0Ozo1fB4Stl+2nXjfLklls/ibO5foMVW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/AmJWWmlnTfgGSEYqeoqCr2vOX59aZvYpC1vbPvwsu0PBCWkvj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148); SRVR:MWHPR07MB3501; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3501; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3501; 4:eV0Hhej0oRoSadMU7i+rZvYGZh1mIymvv5NNO2skaw2fJD/032ieRrRpnoIJ4FZTp77Sy9g1iYSQJrl0VwNjTfn2xT2G4Z3A01F+x/SojIb/SuQyfP73cn+mpw8V8T//jasQ5dmoXXBBPsSjbnPDlIO2/BZfAtPCJMu7NEP8Y6zg7G+LVyfJG98Gz5fhu0gFtmaEUF+JEZPvThpeF9ueC9JvU572t5L1GYXM8B3iRDQuvtKOw2PzcwCn5NvD7brCrgEshvXDtsSGmK3GenE8sPvrJDDQ4xElx7BpoxJj6BuE8CrKxnx6o9KKc27O3YCQm5Jtm9L1d6Fi5UdXRmjSxS7kGBqC/O3vKTyJoaRrBm6O7H/KZnPgS3QFJtpYnIA2TNtg9K5p13d5F/jbMHn9INJMptZ/nCz6q9W3CDPduwA7S3yDw7wwMefk3HgbWgeOuYTK+6p1jIZjoiT/knjjMb3Cm4BfPrNgv/DDhz9tOkn7MyULHV43mu2IjQbZqhDl1VnVO2zASa3wos3IR9uJW9LGJiUK6t2hlSYsO0Qv1KJ2XHBWjgVXg3lasAwBHvmYE8tDdg8O8Ti3oH7rvIL4l4O666S28HV89Qet63/fQzbg1dJ+I2bwSf66YrBrVRQzJ0tNTa2/WlR5HyJ4OBd3Rmq7qx8pDAoUnQV24Y+ITeM2vQZTtn7Q8Qq86eVXH26FOuX/B7r1EF9WkBBYj1q92k+GiuyqL3iiiAeRIf+eREfVWHCpuQfYiqmsbNIiobgF2YyKIQZEXzdq26R3elAG2mYGu4Dgic/uSVDOvjopQLI= X-Forefront-PRVS: 03094A4065 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(39850400002)(50226002)(81166006)(25786009)(8676002)(5003940100001)(33646002)(76176999)(50986999)(53416004)(189998001)(6486002)(53936002)(2906002)(6512007)(2950100002)(6666003)(42186005)(110136004)(107886003)(38730400002)(5660300001)(305945005)(7736002)(4326008)(86362001)(47776003)(478600001)(66066001)(1076002)(3846002)(6116002)(54906002)(72206003)(36756003)(50466002)(6506006); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3501; H:ddl.caveonetworks.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3501; 23:Y8AaAvJbzYspJxamNjRtNpW5DPthipi3wrb+L3kTd?= =?us-ascii?Q?MxbbtfFkgip8QLUjITXF+BaiLDHPKBg/qu0x1G/dGFnvHlf/PkPkk03nVJMm?= =?us-ascii?Q?8O7phZuvSS1mnjnnirq9F2e4nuHjdDnEYg6IuruNgG+0AKCvB0LZhL0BBi6v?= =?us-ascii?Q?Lv+ze12PVsvsR+svhfNJApCsyGIP3gkwBoIoagshGWwLzzHNE4WPL6lDQuI7?= =?us-ascii?Q?qKHribwampkWDeH/YzGCSbIzzPmr0eDPPvOOusyDw//nnAcBJExFhfU3SWux?= =?us-ascii?Q?WBDCeyKzUiIf2w2bs37aexNdZMbRaH6Y1vpL4FJTILVggDL5NVc1pws352n/?= =?us-ascii?Q?FcPwAbRZklvt6Wb7J61RTjMUhsQOyqE6x4K+Il0ok7BZBqTaDFVU3v3MJUt7?= =?us-ascii?Q?pCy2eQlWyD0GJ0hfjocUDWuu8lwfJTLujRO3mcoLbcVgIkONykvodcniyCEE?= =?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KMajigTbQVuw4LnXA9qnY4tJKdNN56JCu1Rd4IFCXNd2dEaYZN/uBUwWCq0H+jIFzLuavxNF0KKn7B6jf1NE35GRbwt/HuSxx598JbDXKTY9d/jHklzIoG1TRWlUoERmPgWnqihYFh32lwrFBHRW9MF11kt1xinuiZOZhmHhvoe9P5WeEe0F6cG81gLjCWxgwhVjwnGAh76a9jqg/4IzydSv0w5do6ltO93G/gYEVgkq/IAYyM8ZXxTgmOULUSj4JfeQTQ9BWVfjAlQ2ZxwoJLLMp6qIxSJkV/GkWoEPrMdvX8kIDw==; 5:fjA7WX6h3m8u282SXeujJL19Olu1R/Qn6hCzCTg1S7gPt5xdWhZnmz2P+hwEWrUEcf6qYt1sxq/jL+vbP4XpT0L5iSL2l0qbKOB5pJRtrSupGJ8kz1s1kR5bk4oqGFrDEg3Wat4Pfhgj/G7flW/wvg==; 24:rbFkkFYpG1xbmaTZi6Z129/Bzh44qDPeoqZGR6/mAQglr0K99HlORQX+MuNddBJJu9Hnvhn4LB/aUO8sIbAlhF25D06H25QOjO7gbWskjZg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3501; 7:4Reuav2qEeklvUjmY/yFGAaPkGYe9U2eyUyIkfD3j030GdlMmnhIb7QtP1la/7PeZiWw9fX+no8TPfHowyncjitl+yFpsUXcqWdxa+pGzycn57uFBU8tltLnJZujX35LSDXTXeRkIa8kyKnwdJ/fdkcC2ox9UmUH4JwmHZHVkLtqAp4dBAGl+zhIMM9rLzn57A81TtuFQvjIZOSfVQeD2PRXm2pd5O86uv/sMDNGLKEoZEmuuV13+1aBdMxA3LhctkHSfHtKnufK1oo/jNToPA4I78bxJSeHjhp9t6u6fwB52eCZPEzNDTd41I+ykUSZwy5pe2XMPqj2+jQRP1PXLA== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2017 00:17:45.5217 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3501 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170515_171809_809682_E4090009 X-CRM114-Status: UNSURE ( 7.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jon Masters , Robert Richter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, David Daney Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When checking to see if a PCI bus can safely be reset, we check to see if any of the children have their PCI_DEV_FLAGS_NO_BUS_RESET flag set. As these devices are know not to behave well after a bus reset. Some PCIe root port bridges also do not behave well after a bus reset, sometimes causing the devices behind the bridge to become unusable. Add a check for the PCI_DEV_FLAGS_NO_BUS_RESET flag being set in the bridge device to allow these bridges to be flagged, and prevent their buses from being reset. A follow on patch will add a quirk for this type of bridge. Signed-off-by: David Daney --- drivers/pci/pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b01bd5b..b64e4d1 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4318,6 +4318,10 @@ static bool pci_bus_resetable(struct pci_bus *bus) { struct pci_dev *dev; + + if (bus->self && (bus->self->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET)) + return false; + list_for_each_entry(dev, &bus->devices, bus_list) { if (dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET || (dev->subordinate && !pci_bus_resetable(dev->subordinate)))